public void Play() { state = VisualEffectState.Playing; if (!this.get_isActiveAndEnabled()) { return; } PlayInternal(); if (Application.get_isPlaying()) { if (m_destroyMethodCoroutine != null) { this.StopCoroutine(m_destroyMethodCoroutine); m_destroyMethodCoroutine = null; } switch (m_destroyMethod) { case VisualEffectDestroyMethod.None: case VisualEffectDestroyMethod.WhenStopped: case VisualEffectDestroyMethod.WhenStoppedAndFinished: break; case VisualEffectDestroyMethod.AfterDelay: m_destroyMethodCoroutine = this.StartCoroutine(DelayedDestructionCheckRoutine()); break; case VisualEffectDestroyMethod.WhenFinished: m_destroyMethodCoroutine = this.StartCoroutine(AutomaticDestructionCheckRoutine()); break; default: throw new ArgumentOutOfRangeException(); } } }
internal void GroupStoppedInternal(VisualEffectStopMethod stopMethod) { state = VisualEffectState.Stopped; if (this.get_isActiveAndEnabled()) { StopInternal(stopMethod); } }
internal void GroupPausedInternal() { state = VisualEffectState.Paused; if (this.get_isActiveAndEnabled()) { PauseInternal(); } }
internal void GroupPlayedInternal() { state = VisualEffectState.Playing; if (this.get_isActiveAndEnabled()) { PlayInternal(); } }
public void Pause() { if (state == VisualEffectState.Playing) { state = VisualEffectState.Paused; if (this.get_isActiveAndEnabled()) { PauseInternal(); } } }
public void Stop(VisualEffectStopMethod stopMethod = VisualEffectStopMethod.Stop) { state = VisualEffectState.Stopped; if (!this.get_isActiveAndEnabled()) { return; } StopInternal(stopMethod); if (m_destroyMethod == VisualEffectDestroyMethod.WhenStoppedAndFinished) { if (stopMethod == VisualEffectStopMethod.StopAndClear) { if (destructionOverride != null) { destructionOverride(this); } else { Object.Destroy(this.get_gameObject()); } return; } if (m_destroyMethodCoroutine != null) { this.StopCoroutine(m_destroyMethodCoroutine); } m_destroyMethodCoroutine = this.StartCoroutine(AutomaticDestructionCheckRoutine()); } else if (m_destroyMethod == VisualEffectDestroyMethod.WhenStopped) { if (destructionOverride != null) { destructionOverride(this); } else { Object.Destroy(this.get_gameObject()); } } }