using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.Core; namespace KairoEngine.CharacterSystem { public class ZombieAttackCommand : ICommand { CharacterController character; Transform target; Vector3 targetPosition; string variant; /// /// Command that creates an action that will make a character follow a target playing a zombie animation. /// /// The CharacterController performing the action. /// The target position that the attack will hit. /// Use "AttackL", "AttackR" or "Attack". public ZombieAttackCommand(CharacterController character, Vector3 targetPosition, string variant) { this.character = character; this.targetPosition = targetPosition; this.variant = variant; } public void Execute() { ZombieAttackAction action = new ZombieAttackAction(character, targetPosition, variant); ActionController actionController = character.GetComponent(); if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }