123456789101112131415161718192021222324252627282930313233 |
- 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<ActionController>();
- if(actionController.HasAction(action) == false)
- {
- actionController.AddAction(action);
- }
- }
- }
- }
|