123456789101112131415161718192021222324252627282930313233 |
- 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<CharacterController> character;
- [BlackboardOnly, RequiredField] public BBParameter<Transform> 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);
- }
- }
- }
|