public override W_BTNode RemoveChild(W_BTNode aNode) { int index = ChildNode.IndexOf(aNode); _results.RemoveAt(index); base.RemoveChild(aNode); return(this); }
public virtual W_BTNode RemoveChild(W_BTNode node) { if (ChildNode.Contains(node)) { ChildNode.Remove(node); return(this); } Debug.Log("子节点中没有匹配对象供删除:" + node.Name); return(this); }
public virtual W_BTNode AddChild(W_BTNode node) { if (!ChildNode.Contains(node)) { ChildNode.Add(node); return(this); } Debug.Log("子节点中已经存在相同的节点!~"); return(this); }
public override NodeTickResult Tick() { NodeTickResult _result = _activeChildNode.Tick(); if (_result == NodeTickResult.End) { _activeChildNode = null; return(NodeTickResult.End); } return(NodeTickResult.Running); }
public override bool OnEvaluate() { if (ChildNode != null && ChildNode.Count != 0) { if (_activeChildNode == null) { _activeChildNodeIndex = 0; _activeChildNode = ChildNode[0]; } return(_activeChildNode.Evaluate()); } return(false); }
public override bool OnEvaluate() { if (ChildNode != null && ChildNode.Count != 0) { foreach (W_BTNode wBtNode in ChildNode) { if (wBtNode.Evaluate()) { _activeChildNode = wBtNode; return(true); } } } return(false); }
public override NodeTickResult Tick() { NodeTickResult _result = _activeChildNode.Tick(); if (_result == NodeTickResult.End) { _activeChildNodeIndex++; if (_activeChildNodeIndex == ChildNode.Count) { _activeChildNode = null; return(NodeTickResult.End); } _activeChildNode = ChildNode[_activeChildNodeIndex]; } return(NodeTickResult.Running); }
public override W_BTNode AddChild(W_BTNode aNode) { _results.Add(NodeTickResult.Running); base.AddChild(aNode); return(this); }