void OnAnimationEnd(M8.Animator.Animate anim, M8.Animator.Take take) { if (take.name == takeExit || take.name == takeCollect) { root.gameObject.SetActive(false); } }
IEnumerator DoMode(Mode toMode) { if (mCurMode == toMode) { yield break; } M8.Animator.Animate exitAnimator = null; string exitTake = ""; M8.Animator.Animate enterAnimator = null; string enterTake = ""; switch (toMode) { case Mode.Intrusive: enterAnimator = intrusiveAnimator; enterTake = intrusiveTakeEnter; break; case Mode.Extrusive: enterAnimator = extrusiveAnimator; enterTake = extrusiveTakeEnter; break; } switch (mCurMode) { case Mode.Extrusive: exitAnimator = extrusiveAnimator; exitTake = extrusiveTakeExit; break; case Mode.Intrusive: exitAnimator = intrusiveAnimator; exitTake = intrusiveTakeExit; break; } if (exitAnimator) { if (!string.IsNullOrEmpty(exitTake)) { yield return(exitAnimator.PlayWait(exitTake)); } exitAnimator.gameObject.SetActive(false); } if (enterAnimator) { enterAnimator.gameObject.SetActive(true); if (!string.IsNullOrEmpty(enterTake)) { yield return(enterAnimator.PlayWait(enterTake)); } } mCurMode = toMode; }