wangguan
2020-11-23 e70a047e1d3a3b476212d49714264cf6871cd9fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using UnityEngine;
using UnityEngine.PostProcessing;
 
namespace TowerDefense.Cameras
{
    /// <summary>
    /// Simple component to select lower quality post processing configurations on mobile
    /// </summary>
    [RequireComponent(typeof(PostProcessingBehaviour))]
    public class PostProcessorConfigurationSelector : MonoBehaviour
    {
        public PostProcessingProfile highQualityProfile;
        
        public PostProcessingProfile lowQualityProfile;
 
        protected virtual void Awake()
        {
            var attachedPostProcessor = GetComponent<PostProcessingBehaviour>();
 
            PostProcessingProfile selectedProfile;
 
#if UNITY_STANDALONE
            selectedProfile = highQualityProfile;
#else
            selectedProfile = lowQualityProfile;
#endif
 
            attachedPostProcessor.profile = selectedProfile;
        }
    }
}