コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 private void OnValueChanged(Blackboard.Type type, object newValue)
 {
     Evaluate();
 }
コード例 #3
0
 private void onBlackboardValueChanged(Blackboard.Type type, object newValue)
 {
     moveToBlackboardKey();
 }
コード例 #4
0
 private void OnDestinationChanged(Blackboard.Type type, object data)
 {
 }
コード例 #5
0
 private void onValueChanged(Blackboard.Type type, ANP_BBValue newValue)
 {
     Evaluate();
 }
コード例 #6
0
ファイル: Player.cs プロジェクト: kieran-alh/PineBT
 void BlackboardListener(Blackboard.Type type, object value)
 {
     Vector3 val = (Vector3)value;
     // Debug.Log($"TYPE: {type} : {value.ToString()}");
 }