using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.Core; namespace KairoEngine.CharacterSystem { public class CharacterUnarmedAttackCommand : 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 CharacterUnarmedAttackCommand(CharacterController character, Vector3 targetPosition) { this.character = character; this.targetPosition = targetPosition; } public void Execute() { CharacterUnarmedAttackAction action = new CharacterUnarmedAttackAction(character, targetPosition); ActionController actionController = character.GetComponent(); if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }