private void Awake() { Instance = this; _inventoryCanvas = _canvasInventoryView.GetComponent <InventoryCanvas>(); _inputSystem = InputSystem.Instance; }
// this is called after Awake() OR after the script is recompiled (Recompile > Disable > Enable) protected virtual void OnEnable() { SceneManager.sceneLoaded += OnSceneLoaded; if (instance == null) { instance = this; } else if (instance != this) { Debug.LogWarning("GAME MANAGER: WARNING - THERE IS ALREADY AN INSTANCE OF GAME MANAGER RUNNING - DESTROYING THIS ONE."); Destroy(this.gameObject); return; } }