|
@@ -9,14 +9,33 @@ namespace GFGGame
|
|
|
|
|
|
public static void ZoomInCenter(GComponent gComponent, GTweenCallback callback = null)
|
|
|
{
|
|
|
- gComponent.SetScale(0.1f, 0.1f);
|
|
|
- gComponent.SetPivot(0.5f, 0.5f);
|
|
|
- gComponent.TweenScale(new Vector2(1, 1), 0.2f).OnComplete(callback);
|
|
|
+ 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)
|
|
|
{
|
|
|
- gComponent.TweenScale(new Vector2(0.1f, 0.1f), 0.2f).OnComplete(callback);
|
|
|
+ callback?.Invoke();
|
|
|
}
|
|
|
}
|
|
|
}
|