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