public override void OnUpdate(GoblinLumberjack owner)
 {
     // Chop wood, what else could this be...
     owner.ChopWood();
     if (owner.IsDoneChoppingWood())
     {
         // Transition to wood mill travel state.
         owner.GetStateMachine().ChangeState(GLumberjack_MillTravel.GetInstance());
     }
 }
예제 #2
0
        public override void OnUpdate(GoblinLumberjack owner)
        {
            //If there is a target tree, then we wish to make the
            // gobling travel to it.
            if (owner.GetTargetTree() != null && !owner.IsDoneChoppingWood())
            {
                // Transition to TreeTravel State.
                owner.GetStateMachine().ChangeState(GLumberjack_TreeTravel.GetInstance());
            }
            else if (owner.GetTargetLumberMill() != null && !owner.IsDoneDropingWood())
            {
                // Transition to Mill Travel State
                owner.GetStateMachine().ChangeState(GLumberjack_MillTravel.GetInstance());
            }


            // Otherwise we do nothing.
        }