45 lines
1021 B
C#
45 lines
1021 B
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年06月06日 星期五 19:06:16
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System;
|
|
using Logic.Action;
|
|
using Logic.AI;
|
|
using NodeCanvas.Framework;
|
|
using ParadoxNotion.Design;
|
|
using RuntimeData;
|
|
|
|
|
|
namespace NodeCanvas.Tasks.Actions
|
|
{
|
|
[Name("判断自己是否拥有技能")]
|
|
[Category("AI节点")]
|
|
[Serializable]
|
|
public class AIParamSelfSkill : BaseActionTask
|
|
{
|
|
public SkillType SkillType;
|
|
|
|
|
|
protected override string desc => $"拥有技能 {SkillType}";
|
|
|
|
|
|
protected override void OnExecute()
|
|
{
|
|
base.OnExecute();
|
|
// 直接从Blackboard获取AICalculatorData
|
|
var data = blackboard.GetVariable<AICalculatorData>("Data");
|
|
if (data?.value?.TargetParam.UnitData == null)
|
|
{
|
|
EndAction(false);
|
|
return;
|
|
}
|
|
|
|
var unit = data.value.TargetParam.UnitData;
|
|
EndAction(unit.GetSkill(SkillType, out _));
|
|
}
|
|
}
|
|
} |