// 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>(); }
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); }