Esempio n. 1
0
        public override void Enter(Action _action, Track _track)
        {
            if (!GameSettings.AllowRadialBlur)
            {
                return;
            }
            this.cameras = Object.FindObjectsOfType <Camera>();
            if (this.cameras == null)
            {
                return;
            }
            int mask = LayerMask.GetMask(new string[]
            {
                "Scene"
            });

            for (int i = 0; i < this.cameras.Length; i++)
            {
                Camera camera = this.cameras[i];
                if ((camera.cullingMask & mask) != 0)
                {
                    RadialBlur radialBlur = camera.GetComponent <RadialBlur>();
                    if (radialBlur == null)
                    {
                        radialBlur = camera.gameObject.AddComponent <RadialBlur>();
                    }
                    radialBlur.blurScale  = this.blurScale;
                    radialBlur.falloffExp = this.falloffExp;
                    radialBlur.UpdateParameters();
                }
            }
        }
Esempio n. 2
0
 public override void Enter(Action _action, Track _track)
 {
     if (GameSettings.AllowRadialBlur)
     {
         this.cameras = UnityEngine.Object.FindObjectsOfType <Camera>();
         if (this.cameras != null)
         {
             string[] layerNames = new string[] { "Scene" };
             int      mask       = LayerMask.GetMask(layerNames);
             for (int i = 0; i < this.cameras.Length; i++)
             {
                 Camera camera = this.cameras[i];
                 if ((camera.cullingMask & mask) != 0)
                 {
                     RadialBlur component = camera.GetComponent <RadialBlur>();
                     if (component == null)
                     {
                         component = camera.gameObject.AddComponent <RadialBlur>();
                     }
                     component.blurScale  = this.blurScale;
                     component.falloffExp = this.falloffExp;
                     component.UpdateParameters();
                 }
             }
         }
     }
 }