Advertisement
Glaedr0173

SummaryState

Sep 24th, 2023 (edited)
762
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using DRSUtils.StateMachine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6.  
  7. public class SummaryState : State<GameController>
  8. {
  9.     #region Singleton
  10.     public static SummaryState Instance;
  11.  
  12.     private void Awake()
  13.     {
  14.         Instance = this;
  15.     }
  16.     #endregion
  17.  
  18.     [SerializeField] SummaryScreen summaryScreen;
  19.    
  20.     GameController gc;
  21.  
  22.     public override void Enter(GameController owner)
  23.     {
  24.         gc = owner;
  25.  
  26.         summaryScreen.gameObject.SetActive(true);
  27.         summaryScreen.RadarCanvas.Clear();
  28.         summaryScreen.UpdateSummary();
  29.     }
  30.  
  31.     public override void Execute()
  32.     {
  33.         if (Input.GetButtonDown("Back"))
  34.         {
  35.             gc.StateMachine.Pop();
  36.         }
  37.     }
  38.  
  39.     public override void Exit()
  40.     {
  41.         summaryScreen.RadarCanvas.Clear();
  42.         summaryScreen.gameObject.SetActive(false);
  43.     }
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement