// remove instance if destroyed private void OnDestroy() { if (_instance == this) { _instance = null; } }
private void Start() { _questInventory = QuestInventory.Instance; _questInventory.onQuestChangedCallback += UpdateUI; // _inventoryUiController = InventoryUIController.Instance; // _inventoryUiController.onInventoryActiveCallback += UpdateUI; UpdateUI(); }
private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; } }