public override void ChildTerminated(GameObject go, BehaviourInterface child, bool result) { child.Deactivate(go); if (childIndex >= childNodes.Count) { if (!isRoot) { parentNode.ChildTerminated(go, this, result); } else { Deactivate(go); } return; } if (!result) { childNodes [childIndex].Activate(go); childIndex++; } else { if (!isRoot) { parentNode.ChildTerminated(go, this, true); } else { Deactivate(go); } } }
public override void ChildTerminated (BehaviourInterface child,bool result) { child.Deactivate (); if (childIndex >= childNodes.Count) { if(!isRoot){ parentNode.ChildTerminated(this,false); }else{ //Debug.Log(gameObject); Deactivate(); } return; } if (!result) { childNodes [childIndex].Activate (); childIndex++; } else { if(!isRoot){ parentNode.ChildTerminated(this,true); }else{ Deactivate(); } } }
public override void ChildTerminated(GameObject go, BehaviourInterface child, bool result) { child.Deactivate(go); childReturns++; if (!result) { if (!isRoot) { parentNode.ChildTerminated(go, this, false); foreach (LeafNode childNode in childNodes) { childNode.Deactivate(go); } } else { Deactivate(go); } } if (!isRoot && childReturns >= childNodes.Count) { parentNode.ChildTerminated(go, this, result); } if (isRoot && childReturns >= childNodes.Count) { Deactivate(go); } }
public override void ChildTerminated (BehaviourInterface child, bool result) { child.Deactivate (); if(!result){ parentNode.ChildTerminated(this,false); }else{ if(leftTotry.Count > 0){ activateRandom(); }else{ parentNode.ChildTerminated(this,true); } } }
public override void ChildTerminated(GameObject go, BehaviourInterface child, bool result) { child.Deactivate(go); if (result) { parentNode.ChildTerminated(go, this, true); } else { if (leftTotry.Count > 0) { activateRandom(go); } else { parentNode.ChildTerminated(go, this, false); } } }
public override void ChildTerminated (BehaviourInterface child,bool result) { child.Deactivate (); childReturns++; if (!result){ if(!isRoot){ parentNode.ChildTerminated(this,false); }else{ Deactivate(); } } if(!isRoot && childReturns >= childNodes.Count){ parentNode.ChildTerminated(this,true); } if (isRoot && childReturns >= childNodes.Count) { Deactivate(); } }