private void CreatePassageInSameRoom(MuseumCell cell, MuseumCell otherCell, CellDirection direction) { MuseumRoom room = cell.room; bool isDisplayCase = Random.value < displayCaseProbability; if (isDisplayCase) { MuseumDisplayCase displayCase = Instantiate(displayCasePrefab) as MuseumDisplayCase; displayCase.Initialize(cell, otherCell, direction); displayCase = Instantiate(displayCasePrefab) as MuseumDisplayCase; displayCase.Initialize(otherCell, cell, direction.GetOpposite()); if (paintings.Length > 0) { string paintingName = paintings[(int)Random.Range(0, paintings.Length)]; displayCase.LoadTexture(paintingName); } } else { MuseumPassage passage = Instantiate(passagePrefab) as MuseumPassage; passage.Initialize(cell, otherCell, direction); passage = Instantiate(passagePrefab) as MuseumPassage; passage.Initialize(otherCell, cell, direction.GetOpposite()); } }
private MuseumRoom CreateMuseumRoom() { MuseumRoom room = ScriptableObject.CreateInstance <MuseumRoom>(); //room.displayWallDirection = CellDirections.RandomValue; rooms.Add(room); return(room); }
public void Initialize(MuseumRoom room) { room.Add(this); }