Example #1
0
    void Awake()
    {
        ClearRoom();

        for (int i = 0; i < RoomCount; i++)
        {
            RoomItemUI RI = CreateNewRoomItem();
            RI.transform.SetParent(RoomItemContent.transform);
            RI.gameObject.SetActive(true);
        }
    }
Example #2
0
    public RoomItemUI CreateNewRoomItem()
    {
        for (int i = 0; i < ListRoomItem.Count; i++)
        {
            if (!ListRoomItem [i].gameObject.activeInHierarchy)
            {
                return(ListRoomItem [i]);
            }
        }

        RoomItemUI RI = CustomUtility.CustomInstantiate(RoomItemPrefab.gameObject).GetComponent <RoomItemUI> ();

        RI.RoomID = ListRoomItem.Count + 1;
        RI.SetRoomInfo("Room " + RI.RoomID, "0", "4");
        ListRoomItem.Add(RI);

        return(RI);
    }