private void OnDestroy() { if (Instance == this) { Instance = null; } }
protected virtual void Awake() { Instance = this; DialogBox = DialogBox ?? FindObjectOfType <DialogBoxUi>(); Loading = Loading ?? FindObjectOfType <LoadingUi>(); SubscribeToEvents(); }
protected virtual void Awake() { if (Msf.Args.DestroyUi) { Destroy(gameObject); return; } Instance = this; DialogBox = DialogBox ?? FindObjectOfType <DialogBoxUi>(); Loading = Loading ?? FindObjectOfType <LoadingUi>(); SubscribeToEvents(); }