Exemple #1
0
    // Use this for initialization
    void Start()
    {
        baseRoomTrigger = this.GetComponentInChildren <BaseRoomTrigger>();
        baseRoomTrigger.AddEventListener(this.gameObject);

        backdoorTrigger = this.GetComponentInChildren <BackdoorTrigger>();
        if (backdoorTrigger)
        {
            backdoorTrigger.AddEventListener(this.gameObject);
        }

        player = SceneUtils.FindObjectOf <PlayerControl>();
    }
Exemple #2
0
    public void OnEntered(BaseRoomTrigger baseRoomTrigger)
    {
        RoomTypeManager roomtypeManager = SceneUtils.FindObjectOf <RoomTypeManager>();

        if (roomtypeManager)
        {
            roomtypeManager.OnRoomFinished(this.roomType);
        }
        baseRoomTrigger.RemoveEventListener(this.gameObject);
        player.OnEnterRoom(this.roomType);

        DoExtraOnEntered();

        DispatchMessage("OnRoomEntered", this);
    }