private IEnumerator UpdateShow(float animation_time) { Transform this_tranform = GetComponent <Transform>(); ScaleAnimator.StartAnimation(ShowEasingType, this_tranform.localScale, Vector3.one, animation_time); yield return(new WaitForSeconds(animation_time)); }
private IEnumerator UpdateHide(float animation_time) { Transform this_tranform = GetComponent <Transform>(); //ScaleAnimator.StartAnimation(EasingFunctions.TYPE.BackInCubic, this_tranform.localScale, Vector3.zero, animation_time); ScaleAnimator.StartAnimation(HideEasingType, this_tranform.localScale, Vector3.zero, animation_time); yield return(new WaitForSeconds(animation_time)); gameObject.SetActive(false); }
// .. COROUTINES private IEnumerator UpdateClicked(float animation_time) { onClick.Invoke(); float grow_time = animation_time * 0.5f; float shrink_time = animation_time * 0.5f; Transform this_tranform = GetComponent <Transform>(); ScaleAnimator.StartAnimation(EasingFunctions.TYPE.BackInCubic, this_tranform.localScale, Vector3.one * BounceFactor, grow_time); yield return(new WaitForSeconds(grow_time)); ScaleAnimator.StartAnimation(EasingFunctions.TYPE.Out, this_tranform.localScale, Vector3.one, shrink_time); yield return(new WaitForSeconds(shrink_time)); }