42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年10月21日 星期二 17:10:56
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System;
|
|
using Logic.AI;
|
|
using NodeCanvas.Framework;
|
|
using ParadoxNotion.Design;
|
|
|
|
|
|
namespace NodeCanvas.Tasks.Actions
|
|
{
|
|
[Name("目标有指定技能")]
|
|
[Category("AI节点")]
|
|
[Serializable]
|
|
public class AIParamIsTargetSkillAttacker : BaseActionTask
|
|
{
|
|
public SkillType TargetSkill;
|
|
|
|
protected override string desc => $"目标有指定技能";
|
|
|
|
|
|
protected override void OnExecute()
|
|
{
|
|
base.OnExecute();
|
|
// 直接从Blackboard获取AICalculatorData
|
|
var data = blackboard.GetVariable<AICalculatorData>("Data");
|
|
if (data?.value?.TargetParam == null)
|
|
{
|
|
EndAction(false);
|
|
return;
|
|
}
|
|
|
|
var targetUnit = data.value.TargetParam.TargetUnitData;
|
|
EndAction(targetUnit?.GetSkill(TargetSkill, out _));
|
|
}
|
|
}
|
|
} |