Example #1
0
 private void Update()
 {
     if (mSequenceNodeNode3 != null && !mSequenceNodeNode3.Finished &&
         mSequenceNodeNode3.Execute(Time.deltaTime))
     {
         Log.I("SequenceNode3 执行完成");
     }
 }
Example #2
0
        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);
        }
Example #3
0
    //[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))
     {
     }
 }
Example #5
0
 void Start()
 {
     sequenceNode.ResetNode(0, 0, null);
     sequenceNode.Execute(true);
 }