IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckEnum.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

36 lines
1.0 KiB
C#

using NodeCanvas.Framework;
using NodeCanvas.Framework.Internal;
using ParadoxNotion.Design;
namespace NodeCanvas.Tasks.Conditions
{
[Category("✫ Blackboard")]
public class CheckEnum : ConditionTask
{
[BlackboardOnly]
public BBObjectParameter valueA = new BBObjectParameter(typeof(System.Enum));
public BBObjectParameter valueB = new BBObjectParameter(typeof(System.Enum));
protected override string info {
get { return valueA + " == " + valueB; }
}
protected override bool OnCheck() {
return Equals(valueA.value, valueB.value);
}
///----------------------------------------------------------------------------------------------
///---------------------------------------UNITY EDITOR-------------------------------------------
#if UNITY_EDITOR
protected override void OnTaskInspectorGUI() {
DrawDefaultInspector();
if ( valueB.varType != valueA.refType ) { valueB.SetType(valueA.refType); }
}
#endif
}
}