protected override bool RunAction(PlayerController player, List <string> commandString) { GameState gameState = player.gameState; var contents = interactiveObject.gameItem.GetContents(player); foreach (var item in contents) { if (item.IsThisTheItem(commandString[1])) { gameState.AddItemToInventory(item); gameState.SetBool("PickedUp(" + item.itemName + ")", true); player.logWindow.AddText("You pickup " + commandString[1]); if (item.sound) { SoundManager.PlaySound(SoundManager.SoundType.SoundFX, item.sound, 1, 1); } return(true); } } return(true); }
protected override bool RunAction(PlayerController player, List <string> commandString) { GameState gameState = player.gameState; gameState.AddItemToInventory(interactiveObject.gameItem); gameState.SetBool("PickedUp(" + interactiveObject.gameItem.itemName + ")", true); player.logWindow.AddText(pickupResponse); if (destroyOnPickup) { Destroy(gameObject); } return(true); }