private void OnValueChanged(Blackboard.Type type, object newValue)
        {
            if (IsActive && !IsConditionMet())
            {
                if (stopsOnChange == Stops.SELF || stopsOnChange == Stops.BOTH || stopsOnChange == Stops.IMMEDIATE_RESTART)
                {
                    // Debug.Log( this.key + " stopped self ");
                    this.Stop();
                }
            }
            else if (!IsActive && IsConditionMet())
            {
                if (stopsOnChange == Stops.LOWER_PRIORITY || stopsOnChange == Stops.BOTH || stopsOnChange == Stops.IMMEDIATE_RESTART || stopsOnChange == Stops.LOWER_PRIORITY_IMMEDIATE_RESTART)
                {
                    // Debug.Log( this.key + " stopped other ");
                    Container parentNode = this.ParentNode;
                    Node      childNode  = this;
                    while (parentNode != null && !(parentNode is Composite))
                    {
                        childNode  = parentNode;
                        parentNode = parentNode.ParentNode;
                    }
                    Assert.IsNotNull(parentNode, "NTBtrStops is only valid when attached to a parent composite");
                    Assert.IsNotNull(childNode);
                    if (parentNode is Parallel)
                    {
                        Assert.IsTrue(stopsOnChange == Stops.IMMEDIATE_RESTART, "On Parallel Nodes all children have the same priority, thus Stops.LOWER_PRIORITY or Stops.BOTH are unsupported in this context!");
                    }

                    ((Composite)parentNode).StopLowerPriorityChildrenForChild(childNode, stopsOnChange == Stops.IMMEDIATE_RESTART || stopsOnChange == Stops.LOWER_PRIORITY_IMMEDIATE_RESTART);
                }
            }
        }
Esempio n. 2
0
 private void OnValueChanged(Blackboard.Type type, object newValue)
 {
     Evaluate();
 }
 private void onBlackboardValueChanged(Blackboard.Type type, object newValue)
 {
     moveToBlackboardKey();
 }
Esempio n. 4
0
 private void OnDestinationChanged(Blackboard.Type type, object data)
 {
 }
 private void onValueChanged(Blackboard.Type type, ANP_BBValue newValue)
 {
     Evaluate();
 }
Esempio n. 6
0
 void BlackboardListener(Blackboard.Type type, object value)
 {
     Vector3 val = (Vector3)value;
     // Debug.Log($"TYPE: {type} : {value.ToString()}");
 }