using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.Core; namespace KairoEngine.CharacterSystem { public class CharacterHandWeaponAttackCommand : ICommand { CharacterController character; Vector3 targetPosition; /// /// Command that creates an unarmed attack action. /// /// The target character to perform the action. /// The target position where the attack will be performed. public CharacterHandWeaponAttackCommand(CharacterController character, Vector3 targetPosition) { this.character = character; this.targetPosition = targetPosition; } public void Execute() { CharacterHandWeaponAttackAction action = new CharacterHandWeaponAttackAction(character, targetPosition); ActionController actionController = character.GetComponent(); if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }