using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.Core; using KairoEngine.Inventory; namespace KairoEngine.CharacterSystem { public class PickupItemCommand : ICommand { CharacterController character; WorldItem worldItem; ItemContainer itemContainer; public PickupItemCommand(CharacterController character, WorldItem worldItem, ItemContainer itemContainer = null) { this.character = character; this.worldItem = worldItem; this.itemContainer = itemContainer; } public void Execute() { CharacterPickupItemAction action = new CharacterPickupItemAction(character, worldItem, itemContainer); ActionController actionController = character.GetComponent(); if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }