Exemple #1
0
    /*
     * public void AssignWorkBuilding(BuildingEmployee building_employee)
     * {
     *      work_building = building_employee;
     *
     *      finalDestination = new Vector2(work_building.GetWorkDestination (this).x, work_building.GetWorkDestination (this).z);
     *      steering.Visit (finalDestination);
     *
     *      state = STATE_MOVING_TO_WORK;
     * }*/

    public void AssignWorkBuilding(BuildingPassenger building_employee)
    {
        building  = building_employee;
        behaviour = building.VisitBuilding(this);

        finalDestination = behaviour.GetEntrancePosition();
        steering.Visit(finalDestination);

        state = STATE_MOVING_TO_WORK;
    }
    /*
    public void AssignWorkBuilding(BuildingEmployee building_employee)
    {
        work_building = building_employee;

        finalDestination = new Vector2(work_building.GetWorkDestination (this).x, work_building.GetWorkDestination (this).z);
        steering.Visit (finalDestination);

        state = STATE_MOVING_TO_WORK;
    }*/
    public void AssignWorkBuilding(BuildingPassenger building_employee)
    {
        building = building_employee;
        behaviour = building.VisitBuilding(this);

        finalDestination = behaviour.GetEntrancePosition();
        steering.Visit(finalDestination);

        state = STATE_MOVING_TO_WORK;
    }
Exemple #3
0
    bool VisitBuilding(string type_name, int _exit_state)
    {
        // get building
        buildingPassenger = (BuildingPassenger)BuildingList.GetPassengerBuilding(this, type_name);

        if (buildingPassenger == null)
        {
            print("could not find building)");
            return(false);
        }
        else
        {
            behaviour        = buildingPassenger.VisitBuilding(this);
            finalDestination = behaviour.GetEntrancePosition();
            steering.Visit(finalDestination);
            state_passenger   = STATE_BUILDING_GOTO;
            buildingExitState = _exit_state;

            // don't forget to remove eventual message
            speechBubbleController.RemoveMessageImmediate(this);
            return(true);
        }
    }
    bool VisitBuilding(string type_name, int _exit_state)
    {
        // get building
        buildingPassenger = (BuildingPassenger) BuildingList.GetPassengerBuilding (this, type_name);

        if (buildingPassenger == null) {
            print("could not find building)");
            return false;
        } else  {
            behaviour = buildingPassenger.VisitBuilding(this);
            finalDestination = behaviour.GetEntrancePosition();
            steering.Visit(finalDestination);
            state_passenger = STATE_BUILDING_GOTO;
            buildingExitState = _exit_state;

            // don't forget to remove eventual message
            speechBubbleController.RemoveMessageImmediate(this);
            return true;
        }
    }