/// <summary> /// Window body hide tween animation, do any changes to hide animation here. /// At start fires action onStart /// </summary> /// <param name="body"></param> /// <param name="onStart"> Action that fires on start</param> private static void Hide(this WindowBody body, Action onStart, Action onComplete) { onStart?.Invoke(); body.CGroup.DoFade(AlphaMin, WindowHIdeTime, () => { onComplete?.Invoke(); body.window.SetActive(false); body.CGroup.DoFade(AlphaOne, TimeInstant); }); }
/// <summary> /// Window Body appear tween animation, do any animation changes here. /// At end of animation fires action /// </summary> /// <param name="body"></param> /// <param name="onComplete"> Action that fires at the end</param> private static void Appear(this WindowBody body, Action onComplete) { //body.window.gameObject.SetActive(false);//disable on start (doublecheck) body.wRect.transform.localScale = WindowSmallSize; body.window.gameObject.SetActive(true); body.wRect.DoScale(WindowNormalSize, WindowAppearTime, () => onComplete?.Invoke()); //onComplete?.Invoke(); }