using System.Collections; using UnityEngine; using FairyGUI; namespace GFGGame { public class ViewAnimationFactory { public static void ZoomInCenter(GComponent gComponent, GTweenCallback callback = null) { Transition transition = (gComponent as Window).contentPane.GetTransition("openViewAction"); if (transition != null) { transition.Play(() => { callback?.Invoke(); }); } else { gComponent.visible = false; gComponent.SetScale(0.7f, 0.7f); gComponent.SetPivot(0.5f, 0.5f); gComponent.TweenFade(0f, 0).OnComplete(() => { gComponent.visible = true; gComponent.TweenFade(1, 0.3f).SetEase(EaseType.QuadOut); gComponent.TweenScale(new Vector2(1, 1), 0.3f).SetEase(EaseType.BackOut).OnComplete(callback); }); } } public static void ZoomOutCenter(GComponent gComponent, GTweenCallback callback) { callback?.Invoke(); } } }