Exemplo n.º 1
0
    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());
        }
    }
Exemplo n.º 2
0
    private MuseumRoom CreateMuseumRoom()
    {
        MuseumRoom room = ScriptableObject.CreateInstance <MuseumRoom>();

        //room.displayWallDirection = CellDirections.RandomValue;
        rooms.Add(room);
        return(room);
    }
Exemplo n.º 3
0
 public void Initialize(MuseumRoom room)
 {
     room.Add(this);
 }