public void TriggerDissolve(bool atomic, bool disableAfterDissolve, AnimationCurve dissolveCurve, float dissolveStartPercent, float time, float speed) { if ((atomic && m_Dissolving) || !m_CanDissolve) { return; } if (m_Materials != null && m_Materials.Length > 0) { m_Dissolving = true; InvokeDissolveStartEvents(); StartCoroutine(DissolveHelper.CurveDissolve(m_Materials, dissolveCurve, time, dissolveStartPercent, speed, () => { m_Dissolving = false; InvokeDissolveEndEvents(); })); } if (disableAfterDissolve) { m_CanDissolve = false; } }
public void TriggerDissolve(float time, float dissolveStartPercent, float speed) { if (atomic && m_Dissolving) { return; } if (m_Materials != null && m_Materials.Length > 0) { if (!(oneTime && m_Dissolving)) { m_Dissolving = true; if (m_CurrentCoroutine != null) { StopCoroutine(m_CurrentCoroutine); } m_CurrentCoroutine = DissolveHelper.CurveDissolve(m_Materials, dissolveCurve, time, dissolveStartPercent, speed); StartCoroutine(YieldDissolve(m_CurrentCoroutine)); } } }