void Start() { viewConfigButton.onClick.AddListener(() => { isShow = !isShow; if (isShow) { ShowMenu(); } else { HideMenu(); } }); for (int i = 0; i < configButtons.Length; i++) { configButtons[i].Init(); } buttonShowAnimation = new UIAnimation((part, t) => { part.transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, Easing.OutBack(t)); part.Alpha = Mathf.Lerp(0.0f, 1.0f, Easing.OutQuad(t)); }); }
public virtual void Hide() { StartCoroutine(KKUtilities.FloatLerp(showAnimationTime * 0.5f, (t) => { panel.Alpha = Mathf.Lerp(panel.DefaultAlpha, 0.0f, Easing.OutQuad(t)); })); StartCoroutine(hideAnimation.GetAnimation(this, hideAnimationTime).OnCompleted(() => { panel.gameObject.SetActive(false); Container.SetActive(false); OnHideAnimationEnd.Invoke(); })); }
void ChangeStateAnimation() { StopAllCoroutines(); var start = circle.RectTransform.anchoredPosition; var end = IsOn ? selectedCirclePosition : unSelectedCirclePosition; if (!gameObject.activeInHierarchy) { Refresh(); return; } AudioManager.Instance.PlaySE("Click", 0.3f); StartCoroutine(KKUtilities.FloatLerp(0.15f, (t) => { circle.RectTransform.anchoredPosition = Vector2.Lerp(start, end, Easing.OutQuad(t)); }).OnCompleted(() => { Refresh(); })); }