Ejemplo n.º 1
0
    void AddDoors()
    {
        // add up
        UICell cellU = InstantiateCell(5, m_RoomConfig.GetUp(), UIItem.eType.Door);
        UIItem doorU = Instantiate <UIItem>(m_RoomConfig.GetDoor(RoomConfig.eDir.UP), cellU.transform);

        cellU.AddItem(doorU);

        // add left
        UICell cellL = InstantiateCell(m_RoomConfig.GetLeft(), 5, UIItem.eType.Door);
        UIItem doorL = Instantiate <UIItem>(m_RoomConfig.GetDoor(RoomConfig.eDir.LEFT), cellL.transform);

        cellL.AddItem(doorL);

        // add bottom
        UICell cellB = InstantiateCell(5, m_RoomConfig.GetDown(), UIItem.eType.Door);
        UIItem doorB = Instantiate <UIItem>(m_RoomConfig.GetDoor(RoomConfig.eDir.DOWN), cellB.transform);

        cellB.AddItem(doorB);

        // add right
        UICell cellR = InstantiateCell(m_RoomConfig.GetRight(), 5, UIItem.eType.Door);
        UIItem doorR = Instantiate <UIItem>(m_RoomConfig.GetDoor(RoomConfig.eDir.RIGHT), cellR.transform);

        cellR.AddItem(doorR);
    }