IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckEnum.cs

36 lines
1.0 KiB
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
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
}
}