Exemplo n.º 1
0
    void IncomingPassengerBehavior()
    {
        if (state == STATE_AIRPLANE_WAITING)
        {
            ;             // do nothing, waiting to get exit path from flight
        }
        else if (state == STATE_AIRPLANE_EXITING)
        {
            if (HasArrived(GridHelper.GetGridCellSize() / 5f))
            {
                steering.Visit(gate.GetEnterPath());
                finalDestination = steering.GetFinalDestination();
                state            = STATE_GATE_EXITING;
            }
        }
        else if (state == STATE_GATE_EXITING)
        {
            if (HasArrived())
            {
                state = STATE_CUSTOMS;
                //print("exiting complete!");
            }
        }
        else if (state == STATE_CUSTOMS)
        {
            //if (VisitPassengerBuilding("Customs", STATE_CUSTOMS_COMPLETE))
            if (VisitBuilding("Customs", STATE_EXIT))
            {
                state = STATE_BUILDING;
            }
            else
            {
                Wandering(STATE_SPAWNED);
                speechBubbleController.SendMessageContinuous(speechBubble_NoCustomns, this,
                                                             SpeechBubbleController.PASSSENGER_NO_CUSTOMNS);
            }

            /*} else if (state == STATE_CUSTOMS_COMPLETE) {
             *      state = STATE_EXIT;*/
        }
        else if (state == STATE_EXIT)
        {
            finalDestination = PassengerController.GetExitPosition(this);
            steering.Visit(finalDestination);

            state = STATE_EXIT_GOTO;
        }
        else if (state == STATE_EXIT_GOTO)
        {
            if (HasArrived())
            {
                PassengerController.RemovePassengers(this);
                Object.Destroy(this.gameObject);
            }
        }
    }