static public int StartFadeOut(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif EZCameraShake.CameraShakeInstance self = (EZCameraShake.CameraShakeInstance)checkSelf(l); System.Single a1; checkType(l, 2, out a1); self.StartFadeOut(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
private IEnumerator RemoveInstance(CameraShakeInstance shake, float fadeOutTime) { if (shake.CurrentState != CameraShakeState.Inactive) { shake.StartFadeOut(fadeOutTime); yield return(new WaitForSeconds(fadeOutTime)); } cameraShakeInstances.Remove(shake); }
public IEnumerator shake() { EZCameraShake.CameraShakeInstance shakeInstance = EZCameraShake.CameraShaker.Instance.StartShake(2, 2, 0.1f); yield return(new WaitForSeconds(0.15f)); shakeInstance.StartFadeOut(0.1f); yield return(null); }