Added Behavior Graph asset for AI simulations
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable, Unity.Properties.GeneratePropertyBag]
|
||||
[Condition(name: "GameObject Null", story: "[Target] [is] null", category: "Conditions", id: "6bc7c2e1cf9d2d4a14b5c3ac1b47da1d")]
|
||||
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