using System.Collections; using System.Collections.Generic; using UnityEngine; using NodeCanvas.Framework; using ParadoxNotion.Design; using KairoEngine.Core; namespace KairoEngine.CharacterSystem { [Category("KairoEngine")] public class CharacterAimTaskAction : ActionTask { [BlackboardOnly, RequiredField] public BBParameter character; [BlackboardOnly, RequiredField] public BBParameter target; protected override string info { get { return "Aim at Target"; } } protected override void OnExecute() { if(target.value == false) EndAction(false); ICommand mousePosCommand = new TurnCommand(character.value, target.value.position); CommandInvoker.AddCommand(mousePosCommand); ICommand aimCommand = new CharacterAimCommand(character.value, target.value); CommandInvoker.AddCommand(aimCommand); EndAction(true); } } }