protected virtual void Awake() { Container.SetActive(false); Vector3 startScale = Vector3.one * 0.5f; Vector3 endScale = Vector3.one; showAnimation = new UIAnimation((parts, t) => { parts.transform.localScale = Vector3.LerpUnclamped(startScale, endScale, Easing.OutBack(t, 3.0f)); }); }
protected override void Awake() { base.Awake(); DefaultUGUIFontSettings = new FontSettings(textPool.GetOriginal); DefaultUGUIFontSettings.anchor = TextAnchor.UpperCenter; DefaultUGUIFontSettings.showAnimation =new UIAnimation((part, t)=> { part.transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, Easing.OutBack(t)); part.transform.TranslateY(50.0f * Time.deltaTime); }); DefaultUGUIFontSettings.hideAnimation = UIAnimationUtil.DefaultHideAnimation; DefaultUGUIFontSettings.showAnimationTime = 0.5f; DefaultUGUIFontSettings.limitLife = 0.3f; DefaultUGUIFontSettings.hideAnimationTime = 0.5f; Default3DFontSettings = new FontSettings(textMeshPool.GetOriginal); if (uiCamera == null) uiCamera = Camera.main; }
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 static Coroutine PopUp(this UGUIParts self, float duration) { self.transform.localScale = Vector3.zero; self.gameObject.SetActive(true); return(self.StartCoroutine(KKUtilities.FloatLerp(duration, (t) => { self.transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, Easing.OutBack(t)); }))); }