// Start is called before the first frame update void Start() { if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } DontDestroyOnLoad(gameObject); }
// UIManager methods public override void OnEnable() { base.OnEnable(); if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this); if (DevCanvas != null) { DevCanvas.SetActive(HubrisCore.Instance.Debug); } _msgList = new List <Msg>(); _inputList = new List <string>(); }