so i wrote my own script for comparison between 2 variables and the sharedGameObject variable will not take the object that uses him automatically like a Settriget task etc.
that's the code example :
BehaviorDesigner.Runtime.Tasks.Unity.UnityAnimator
{
public class ComperToMyHealth : Action
{
[Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
public SharedGameObject mySlef;
private NPC npc;
[Tooltip("The variable to compare to")]
public SharedInt compareTo;
private GameObject prevGameObject;
public override void OnStart()
{
}
public override TaskStatus OnUpdate()
{
return mySlef.Value.GetComponent<NPC>().HP.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure;
}
public override void OnReset()
{
mySlef = null;
compareTo = 0;
}
}
}
that's the code example :
BehaviorDesigner.Runtime.Tasks.Unity.UnityAnimator
{
public class ComperToMyHealth : Action
{
[Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
public SharedGameObject mySlef;
private NPC npc;
[Tooltip("The variable to compare to")]
public SharedInt compareTo;
private GameObject prevGameObject;
public override void OnStart()
{
}
public override TaskStatus OnUpdate()
{
return mySlef.Value.GetComponent<NPC>().HP.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure;
}
public override void OnReset()
{
mySlef = null;
compareTo = 0;
}
}
}