Esempio n. 1
0
        public override void Init(ISkillCellData cellData, SkillBase skillBase)
        {
            if (m_cameraFollow != null && m_cameraFollow.IsDisableCameraShake() == false)
            {
                Invoke("ShakeStart", ((CameraShakeCellDesc)cellData).playTime + 0.000002f); // 这里加个0.000002f 让ShakeStart函数在Start后执行
            }

            //active the camera blur
            if (((CameraShakeCellDesc)cellData).fBlurTime > 0.0f)
            {
                GameObject obj = GameObject.FindGameObjectWithTag("MainCamera");
                if (obj)
                {
                    DeemoRadialBlur blur = obj.GetComponent <DeemoRadialBlur>();

                    if (blur)
                    {
                        //  GameObject blurObj = blur.;
                        //  blurObj.SetActive(true);

                        blur.enabled = true;

                        Invoke("Endblur", ((CameraShakeCellDesc)cellData).fBlurTime);
                    }
                }
            }
        }
Esempio n. 2
0
        private void DoShake()
        {
            if (null == mCameraBase && null != CoreEntry.gCameraMgr.MainCamera)
            {
                mCameraBase = CoreEntry.gCameraMgr.MainCamera.GetComponent <CameraBase>();
            }

            if (null != mCameraBase)
            {
                if (!mCameraBase.IsDisableCameraShake() && !mCameraBase.m_cameraShake)
                {
                    mCameraBase.m_cameraShake = true;
                    mStartAniTime             = Time.time;

                    float t = mAniCurve[mAniCurve.length - 1].time;
                    Invoke("EndShake", t);
                }
            }

            Invoke("DoShake", mDuration);
        }