Added Behavior Graph asset for Unity
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable, Unity.Properties.GeneratePropertyBag]
|
||||
[Condition(name: "Target Null", story: "[Target] [is] null", category: "Conditions", id: "83ee136bdfeb6568a8a2fb0a340e6e69")]
|
||||
public partial class GameObjectNullCondition : Condition
|
||||
{
|
||||
[SerializeReference] public BlackboardVariable<GameObject> Target;
|
||||
[Comparison(comparisonType: ComparisonType.Boolean)]
|
||||
[SerializeReference] public BlackboardVariable<ConditionOperator> Is;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
if (Is.Value == ConditionOperator.Equal)
|
||||
{
|
||||
return Target.Value == null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Target.Value != null;
|
||||
}
|
||||
|
||||
return (Target.Value == null && Is.Value == ConditionOperator.Equal) ||
|
||||
(Target.Value != null && Is.Value == ConditionOperator.NotEqual);
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnEnd()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user