Пример #1
0
        private void UpdateCameraDofCustom()
        {
            FakeDOF component = base.GetComponent <FakeDOF>();

            if (component != null)
            {
                if (this._dofCustomState != CameraDOFCustomState.Active)
                {
                    if (component.backgroundBlurFactor < 0.01f)
                    {
                        component.enabled = false;
                    }
                }
                else
                {
                    component.enabled = true;
                    if (((this._dofAnimationCurve != null) && (this._dofCustomDuration > 0f)) && ((this._dofCustomDuration > 0f) && (this._dofAnimationCurve != null)))
                    {
                        this._dofCustomTimer += Time.deltaTime;
                        float time = this._dofCustomTimer / this._dofCustomDuration;
                        float num2 = this._dofAnimationCurve.Evaluate(time);
                        component.backgroundBlurFactor = num2 * 5f;
                        if (time > 1f)
                        {
                            this._dofCustomState = CameraDOFCustomState.Done;
                        }
                    }
                }
            }
        }
Пример #2
0
 public void SetCameraFakeDOFCustommed(AnimationCurve cureve, float duration)
 {
     this._dofAnimationCurve = cureve;
     this._dofCustomTimer    = 0f;
     this._dofCustomDuration = duration;
     this._dofCustomState    = CameraDOFCustomState.Active;
 }