Esempio n. 1
0
 /// <summary>
 /// Adds a output to Behavior tree node
 /// </summary>
 public void AddOutput()
 {
     if (IsDecision)
     {
         BTNodeOutput o = new BTNodeOutput(this);
         outputs.Add(o);
     }
 }
Esempio n. 2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            if (IsDecision && outputs.Count > 0)
            {
                BTNodeOutput output = outputs[0];
                if (IsSingleChild && output.TargetInputs.Length > 1)
                {
                    for (int j = 1; j < output.TargetInputs.Length; j++)
                    {
                        Debug.Log("[MoonBehavior] Single child node; Removing extra connections: " + output.TargetInputs[j].Parent.name);
                        output.ClearTarget(output.TargetInputs[j]);
                    }
                }
            }
        }