Пример #1
0
 public void CreateRoom_Golden()
 {
     HallTransfer.RoomInfoS roomInfo;
     for (int i = 0; i < 3; i++)
     {
         GameObject temp_obj = null;
         temp_obj = (GameObject)Instantiate(m_objCurGameRoomItem, Vector3.zero, m_objCurGameRoomItem.transform.localRotation);
         Debug.LogWarning("CurGameRoomItem:" + m_objCurGameRoomItem.name);
         temp_obj.transform.name          = "RoomItem" + i;
         temp_obj.transform.parent        = m_objCurRoomGrid.transform;
         temp_obj.transform.localPosition = new Vector3(i == 1?30:0, -156 * i, 0);
         temp_obj.transform.localScale    = Vector3.one;
         temp_obj.SetActive(true);
         CGameRoomItem roomItem = temp_obj.GetComponent <CGameRoomItem>();
         if (i < m_lstRoomInfoList.Count)
         {
             roomInfo = m_lstRoomInfoList[i];
             roomItem.UpdateRoomItem(roomInfo);
             temp_obj.GetComponent <UISprite>().spriteName = "lobby_room" + i.ToString() + "0";
             Color tempColor = Color.white;
             if (i == 0)
             {
                 tempColor = new Color(39f / 255f, 255f / 255f, 90f / 255f);
             }
             else if (i == 1)
             {
                 tempColor = new Color(39f / 255f, 186f / 255f, 255f / 255f);
             }
             else if (i == 2)
             {
                 tempColor = new Color(255f / 255f, 39f / 255f, 197f / 255f);
             }
             temp_obj.transform.FindChild("room_light").GetComponent <UISprite>().color = tempColor;
             UIEventListener.Get(temp_obj).onClick = GameRoom_OnClick;
             m_lstRoomItemList.Add(roomItem);
         }
         else
         {
             temp_obj.GetComponent <UISprite>().spriteName = "lobby_room" + i.ToString() + "1";
             DestroyImmediate(temp_obj.transform.FindChild("room_light").gameObject);
         }
     }
     if (this.GetComponent <TweenPosition>() != null)
     {
         this.GetComponent <TweenPosition>().ResetToBeginning();
         this.GetComponent <TweenPosition>().PlayForward();
     }
     this.transform.localScale = Vector3.one;
 }
Пример #2
0
 /// <summary>
 /// 创建房间
 /// </summary>
 public void CreateRoom_default()
 {
     HallTransfer.RoomInfoS roomInfo;
     for (int i = 0; i < m_lstRoomInfoList.Count; i++)
     {
         roomInfo = m_lstRoomInfoList[i];
         GameObject temp_obj = null;
         temp_obj = (GameObject)Instantiate(m_objCurGameRoomItem, Vector3.zero, m_objCurGameRoomItem.transform.localRotation);
         Debug.LogWarning("CurGameRoomItem:" + m_objCurGameRoomItem.name);
         temp_obj.transform.name       = "RoomItem" + m_lstRoomItemList.Count.ToString();
         temp_obj.transform.parent     = m_objCurRoomGrid.transform;
         temp_obj.transform.localScale = Vector3.one;
         temp_obj.SetActive(true);
         UIEventListener.Get(temp_obj).onClick = GameRoom_OnClick;
         CGameRoomItem roomItem = temp_obj.GetComponent <CGameRoomItem>();
         roomItem.UpdateRoomItem(roomInfo);
         m_lstRoomItemList.Add(roomItem);
     }
     Invoke("ResetRoomPosition_default", 0.1f);
 }
Пример #3
0
    public void CreateRoom_GameblePC()
    {
        HallTransfer.RoomInfoS roomInfo;
        this.transform.localScale = Vector3.one;        //new Vector3(1f,0f,0f);
        for (int i = 0; i < m_lstRoomInfoList.Count; i++)
        {
            roomInfo = m_lstRoomInfoList[i];
            GameObject temp_obj = null;
            temp_obj = (GameObject)Instantiate(m_objCurGameRoomItem, Vector3.one, m_objCurGameRoomItem.transform.localRotation);
            Debug.LogWarning("CurGameRoomItem:" + m_objCurGameRoomItem.name);
            temp_obj.transform.name       = "RoomItem" + m_lstRoomItemList.Count.ToString();
            temp_obj.transform.parent     = m_objCurRoomGrid.transform;
            temp_obj.transform.localScale = Vector3.one;
            temp_obj.SetActive(true);
            UIEventListener.Get(temp_obj).onClick = GameRoom_OnClick;
            CGameRoomItem roomItem = temp_obj.GetComponent <CGameRoomItem>();
            roomItem.UpdateRoomItem(roomInfo);
            m_lstRoomItemList.Add(roomItem);
        }
//		m_objCurGameRoomType.GetComponentInChildren<UIScrollView>().enabled = true;
        Invoke("ResetRoomPosition_GameblePC", 0.2f);
    }
Пример #4
0
    public void CreateRoom_Relax()
    {
        HallTransfer.RoomInfoS roomInfo;
        for (int i = 0; i < m_lstRoomInfoList.Count; i++)
        {
            roomInfo = m_lstRoomInfoList[i];
            GameObject temp_obj = null;
            temp_obj = (GameObject)Instantiate(m_objCurGameRoomItem, Vector3.zero, m_objCurGameRoomItem.transform.localRotation);
            Debug.LogWarning("CurGameRoomItem:" + m_objCurGameRoomItem.name);
            temp_obj.transform.name       = "RoomItem" + m_lstRoomItemList.Count.ToString();
            temp_obj.transform.parent     = m_objCurRoomGrid.transform;
            temp_obj.transform.localScale = Vector3.one;
            temp_obj.SetActive(true);
            UIEventListener.Get(temp_obj).onClick = GameRoom_OnClick;
            CGameRoomItem roomItem = temp_obj.GetComponent <CGameRoomItem>();
            roomItem.UpdateRoomItem(roomInfo);
            // 休闲版独立更新游戏房间图片(暂时)
            roomItem.UpdateRoomSprite((i % 4));
            m_lstRoomItemList.Add(roomItem);
            // 判断当前几个房间.不同房间不同设置
//			if(m_lstRoomInfoList.Count <= 1)
//			{
//				temp_obj.transform.localPosition = m_vRoomItemPos[1];
//			}else if(m_lstRoomInfoList.Count == 2){
//				temp_obj.transform.localPosition = m_vRoomItemPos[i+3];
//			}else if(m_lstRoomInfoList.Count >= 3){
//				temp_obj.transform.localPosition = m_vRoomItemPos[(i%3)];
//			}
            // 前三个房间显示出来.其他暂时隐藏.
//			if(i <= 2)
//			{
//				temp_obj.transform.localScale = Vector3.one;
//			}
        }
        m_objCurGameRoomType.transform.localScale = Vector3.one;
        Invoke("ResetRoomPosition_relax", 0.1f);
    }