protected virtual void Update() { if (Input.GetKeyDown(spawnLargeQuantityKey)) { _objectSpawner.ClearObjects(); _objectSpawner.CreateManyWorldObjects(); } else if (Input.GetKeyDown(destroyAllItemsKey)) { _objectSpawner.ClearObjects(); } else if (Input.GetKeyDown(saveObjectsKey)) { _objectSpawner.SaveObjectSpawner(); } else if (Input.GetKeyDown(inventoryKey)) { _inventoryUI.ToggleInventoryUI(); } else if (Input.GetKeyDown(forceCloseUI)) { _inventoryUI.ToggleInventoryUI(true); } else if (Input.GetKeyDown(clearInventory)) { PlayerState.Instance.Inventory.EmptyInventory(); } else if (Input.GetKeyDown(savePlayerState)) { PlayerState.Instance.SavePlayerState(); } }
/// <summary> /// Try to load scene state from save files /// </summary> private void InitializeLevel() { if (_objectSpawner != null) { bool hasSave = _objectSpawner.LoadObjectSpawner(); if (!hasSave) { _objectSpawner.CreateManyWorldObjects(); } } }