1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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.4f, 0.4f);
- gComponent.SetPivot(0.5f, 0.5f);
- gComponent.TweenFade(0, 0).OnComplete(() =>
- {
- gComponent.visible = true;
- gComponent.TweenFade(1, 0.3f);
- gComponent.TweenScale(new Vector2(1, 1), 0.3f).SetEase(EaseType.BackOut).OnComplete(callback);
- });
- }
- }
- public static void ZoomOutCenter(GComponent gComponent, GTweenCallback callback)
- {
- callback?.Invoke();
- }
- }
- }
|