// 102 public bool JoinRoom(string roomN) { if (RoomSystem.RS.roomMarks.ContainsKey(roomN)) { RoomContainer room = RoomSystem.RS.roomMarks[roomN]; RoomBed bed = AddComponent <RoomBed>(); bed.master = this; return(room.JoinRoom(bed)); } return(false); }
// 101 public bool CreateRoom(string roomN) { if (!RoomSystem.RS.roomMarks.ContainsKey(roomN)) { RoomBed bed = AddComponent <RoomBed>(); bed.master = this; RoomContainer room = AddComponent <RoomContainer>(); room.InitRoom(roomN, bed); RoomSystem.RS.roomMarks.Add(roomN, room); return(true); } else { return(false); } }
public override void OnDestroy() { base.OnDestroy(); master = null; room = null; }