private void OnCountersIncreased() { if (guiCounter == 1) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; characterSwitch.SetLocked(true); } if (characterInputCounter[characterSwitch.GetCurrentCharacterIndex()] == 1) { Opsive.ThirdPersonController.EventHandler.ExecuteEvent(characterSwitch.GetCurrentCharacter(), "OnAllowGameplayInput", false); } }
void DropTheRestItems(int size) { if (size < mainInventory.ItemsInInventory.Count) { for (int i = size; i < mainInventory.ItemsInInventory.Count; i++) { GameObject dropItem = Instantiate(mainInventory.ItemsInInventory[i].itemModel); dropItem.AddComponent <PickUpItem>(); dropItem.GetComponent <PickUpItem>().item = mainInventory.ItemsInInventory[i]; dropItem.transform.localPosition = characterSwitch.GetCurrentCharacter().transform.localPosition; } } }
public override void Spawn() { transform.SetParent(characterSwitch.transform); if (missionCriticalCharacter) { Destroy(GameObject.Find("Menu UI")); SceneManager.LoadSceneAsync("Title", LoadSceneMode.Single); } else if (characterSwitch.GetCurrentCharacter() == gameObject) { characterSwitch.Switch(); } }
public void Create(int itemId, int itemAmount) { StorageInventory destinationStorage = characterSwitch.GetCurrentCharacter().GetComponentInChildren <StorageInventory>(); destinationStorage.AddItemToStorage(itemId, itemAmount); }