Target eliminated, good job 47

This commit is contained in:
MacBuilder
2025-11-10 15:55:28 +01:00
parent dec7ced2d1
commit d647bb5707
10 changed files with 251 additions and 1401 deletions

View File

@@ -1,7 +1,6 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using SkiaSharp.Unity;
using Input;
using AppleHills.Core;
using UI.Core;
@@ -11,8 +10,6 @@ using UI;
public class AppSwitcher : UIPage
{
public GameObject rainbowIn;
public GameObject rainbowOut;
public GameObject gameLayoutContainer;
public GameObject exitButton;
public RectMask2D rectMask;
@@ -20,8 +17,6 @@ public class AppSwitcher : UIPage
[Header("Slide Animation Settings")]
public float slideDuration = 0.5f;
private SkottiePlayerV2 rainbowInPlayer;
private SkottiePlayerV2 rainbowOutPlayer;
private TweenBase slideInTween;
private TweenBase slideOutTween;
@@ -30,16 +25,13 @@ public class AppSwitcher : UIPage
base.OnManagedAwake();
PageName = "AppSwitcher";
rainbowInPlayer = rainbowIn.GetComponent<SkottiePlayerV2>();
rainbowOutPlayer = rainbowOut.GetComponent<SkottiePlayerV2>();
if (rectMask == null)
{
rectMask = GetComponent<RectMask2D>();
}
// Initially hide both
rainbowIn.SetActive(true);
// Initially hide
exitButton.SetActive(false);
}
@@ -49,27 +41,19 @@ public class AppSwitcher : UIPage
gameLayoutContainer.SetActive(true);
// Hide rainbow out, show rainbow in
rainbowOut.SetActive(false);
// Play animation on rainbow in without resetting state
rainbowInPlayer.PlayAnimation(true);
// Slide in animation - tween padding.left from 1700 to 0
slideInTween = TweenPaddingLeft(1700f, 0f, Tween.EaseOut, () =>
{
onComplete?.Invoke();
rainbowOut.SetActive(true);
exitButton.SetActive(true);
});
}
protected override void DoTransitionOut(Action onComplete)
{
rainbowIn.SetActive(false);
// Play animation on rainbow out with resetting state
rainbowOutPlayer.PlayAnimation(true);
// Hide the exit button
exitButton.SetActive(false);
@@ -77,7 +61,6 @@ public class AppSwitcher : UIPage
// Slide out animation - tween padding.left from 0 to 1700
slideOutTween = TweenPaddingLeft(0f, 1700f, Tween.EaseIn, () => {
gameLayoutContainer.SetActive(false);
rainbowIn.SetActive(true);
onComplete?.Invoke();
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
});