Esempio n. 1
0
        public void UpdateExecution()
        {
            switch (state)
            {
            case State.Init:
                puppet.agent.SetDestination(devicePosition);
                state = State.ApproachingDevice;
                break;

            case State.ApproachingDevice:
                if (puppet.agent.remainingDistance <= puppet.agent.stoppingDistance)
                {
                    device.StartConstruction();
                    state = State.Constructing;
                }
                break;

            case State.Constructing:
                if (device.IsFinished())
                {
                    state = State.Done;
                }
                break;

            default:
                break;
            }
        }