private void Update() { if (mSequenceNodeNode3 != null && !mSequenceNodeNode3.Finished && mSequenceNodeNode3.Execute(Time.deltaTime)) { Log.I("SequenceNode3 执行完成"); } }
public void test_failed_at_first() { var testNode = new SequenceNode( "testNode", new List <IBehaviorNode>() { failureNode1.Object, failureNode2.Object }); testNode.Execute(bContext.Object); failureNode1.Verify(x => x.Execute(bContext.Object)); failureNode2.Verify(x => x.Execute(bContext.Object), Times.Never); }
//[UnityTest] public IEnumerator SequenceNodeTest() { var stopwatch = new Stopwatch(); stopwatch.Start(); var sequenceNode = new SequenceNode(); sequenceNode.Append(DelayAction.Allocate(1, () => { })); sequenceNode.Append(DelayAction.Allocate(1, () => { })); sequenceNode.Append(DelayAction.Allocate(1, () => { stopwatch.Stop(); })); while (!sequenceNode.Execute(Time.deltaTime)) { yield return(null); } Debug.Log(stopwatch.ElapsedMilliseconds); }
public override void OnComponentUpdate(float dt) { if (!mSequenceNode.Finished && mSequenceNode.Execute(dt)) { } }
void Start() { sequenceNode.ResetNode(0, 0, null); sequenceNode.Execute(true); }