Created
April 6, 2020 16:34
-
-
Save neonm3/7466bbeb52e18cbf03e271333ec4df84 to your computer and use it in GitHub Desktop.
Global Manager singleton if necessary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class GM : MonoBehaviour | |
{ | |
public const int STAGE_ATTRACTOR = 1; | |
public const int STAGE_HUMAN_DETECTED = 2; | |
public const int STAGE_BUTTON_INTERACT = 3; | |
public const int STAGE_POPUP_SHOWN = 4; | |
public int gameStage; | |
public XMLStruct config; | |
public Text debugText; | |
private static GM _instance; | |
public static GM inst { get { return _instance; } } | |
public void Log(string meh) | |
{ | |
inst.debugText.text += meh + "\n"; | |
} | |
private void Awake() | |
{ | |
if (_instance != null && _instance != this) | |
{ | |
Destroy(this.gameObject); | |
} | |
else | |
{ | |
_instance = this; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment