using game; using UnityEngine; using UnityEngine.UI; public class TestPlayWindow : ParameterlessWindow { [SerializeField] private Button loseButton; [SerializeField] private Button winButton; [SerializeField] private Button chestWindow; [SerializeField] private Button offline; [SerializeField] private Button daily; protected override void OnInit() { loseButton.onClick.AddListener(ShowLose); winButton.onClick.AddListener(ShowWin); chestWindow.onClick.AddListener(ShowChest); offline.onClick.AddListener(ShowOffline); daily.onClick.AddListener(ShowDaily); } private void ShowLose() { Close(); UI.ShowWindow(); } private void ShowWin() { Close(); UI.ShowWindow(); } private void ShowChest() { Close(); Save.Inventory.RemoveConsumableItem(EnumConsumable.KEY, Save.Inventory.GetConsumableItemAmount(EnumConsumable.KEY)); Save.Inventory.AddConsumableItem(EnumConsumable.KEY, 3); UI.ShowWindow(new ChestsGenerator()); } private void ShowOffline() { Close(); UI.ShowWindow(Random.Range(0, 300)); } private void ShowDaily() { Close(); UI.ShowWindow(new DailyReward(G.Instance.Configs.Get("@time_rewards/daily_reward"))); } }