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); } } } }
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); }