ViewAnimationFactory.cs 620 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using UnityEngine;
  3. using FairyGUI;
  4. namespace GFGGame
  5. {
  6. public class ViewAnimationFactory
  7. {
  8. public static void ZoomInCenter(GComponent gComponent, GTweenCallback callback = null)
  9. {
  10. gComponent.SetScale(0.1f, 0.1f);
  11. gComponent.SetPivot(0.5f, 0.5f);
  12. gComponent.TweenScale(new Vector2(1, 1), 0.2f).OnComplete(callback);
  13. }
  14. public static void ZoomOutCenter(GComponent gComponent, GTweenCallback callback)
  15. {
  16. gComponent.TweenScale(new Vector2(0.1f, 0.1f), 0.2f).OnComplete(callback);
  17. }
  18. }
  19. }