Example #1
0
        public void Loop(BaseGoal root)
        {
            this.root = root;
            this.loop = true;

            this.root.Initialize();
        }
Example #2
0
        public void Once(BaseGoal root)
        {
            this.root = root;
            this.loop = false;

            this.root.Initialize();
        }
Example #3
0
        private void Update()
        {
            var root = this.root;
            var loop = this.loop;

            if (root == null)
            {
                return;
            }

            var result = root.Tick();

            if (!loop && result != GoalResult.Running)
            {
                this.root.Terminate();
                this.root = null;
            }
        }