Beispiel #1
0
    public void SetRoomData(qp_server.pb_room_data roomData)
    {
        qp_server.pb_room_cfg roomCfg = roomData.cfg;
        //设置房间信息
        RoomCfg cfg = new RoomCfg(
            roomCfg.room_name,
            roomCfg.is_aa,
            roomCfg.double_down_score,
            roomCfg.is_laizi_playmethod,
            roomCfg.is_ob,
            roomCfg.is_random,
            roomCfg.is_not_voice,
            roomCfg.is_safe_mode,
            roomCfg.lock_userid_list);

        GlobalData.Ins.roomCfg = cfg;
        int selfSeatNumber = -1;

        foreach (var pbRoomUser in roomData.room_users)
        {
            qp_server.pb_user_public_data roomUserPublicData = pbRoomUser.user_public_data;
            RoomUser roomUser = new RoomUser(roomUserPublicData.user_id, roomUserPublicData.nick_name, roomUserPublicData.avatar_url, pbRoomUser.seat_number);
            GlobalData.Ins.allRoomUsers.Add(roomUserPublicData.user_id, roomUser);
            if (roomUserPublicData.user_id == GlobalData.Ins.userId)
            {
                selfSeatNumber = pbRoomUser.seat_number;
            }
        }

        GlobalData.Ins.currentRoomId     = roomData.room_id;
        GlobalData.Ins.currentSeatNumber = selfSeatNumber;
    }
Beispiel #2
0
        public void BuildLocatorObj(SERoomDataTree dataTree)
        {
            m_roomObj  = dataTree.mOutRoomObj;
            m_roomData = dataTree.mRoomData;
            RoomCfg roomCfg = m_roomObj.AddComponent <RoomCfg>();

            roomCfg.GUID      = m_GUID;
            roomCfg.roomObjID = m_roomObjID;
            m_roomObj.transform.localPosition = new Vector3(m_roomObj.transform.localPosition.x, -0.1f, m_roomObj.transform.localPosition.z);
            m_locatorObj   = m_roomObj.transform.Find("Locator").gameObject;
            m_RTLocatorObj = m_roomObj.transform.Find("LocatorRT").gameObject;
//             for (int i = 0; i < m_gateList.Count; i++ )
//             {
//                 if (!m_gateList[i].isGateOpen)
//                 {
//                     Transform childTrans = m_roomObj.transform.Find("GateLocate_" + strGatesPrefix[i]);
//                     if (null != childTrans)
//                     {
//                         childTrans.gameObject.SetActive(false);
//                     }
//                     continue;
//                 }
//
//                 Transform childTrans1 = m_roomObj.transform.Find("RemovableGate_" + strGatesPrefix[i]);
//                 if (null != childTrans1)
//                 {
//                     childTrans1.gameObject.SetActive(false);
//                 }
//                 //重新生成障碍相关的二维表数据
//                 ConfigObstacleArray((ENGateDirection)i);
//                 //房间门位置相关信息生成
//                 childTrans1 = m_roomObj.transform.Find("GateLocate_" + strGatesPrefix[i]);
//                 if (null != childTrans1)
//                 {
//                     childTrans1.gameObject.SetActive(false);
//                     SceneGateInfo gateInfo = GameTable.SceneGateTableAsset.Lookup(m_gateList[i].gateObjId);
//                     if (null != gateInfo)
//                     {
//                         GameResPackage.AsyncLoadObjectData data = new GameResPackage.AsyncLoadObjectData();
//                         IEnumerator e = PoolManager.Singleton.Coroutine_Load(GameData.GetPrefabPath(gateInfo.prefabName), data);
//                         while (true)
//                         {
//                             e.MoveNext();
//                             if (data.m_isFinish)
//                             {
//                                 break;
//                             }
//                             yield return e.Current;
//                         }
//                         if (data.m_obj != null)
//                         {
//                             GameObject obj = data.m_obj as GameObject;
//                             obj.transform.parent = childTrans1.parent;
//                             obj.transform.position = new Vector3(childTrans1.position.x, 0f, childTrans1.position.z);
//                             obj.transform.rotation = childTrans1.rotation;
//                             GateCfg gatecfg = obj.AddComponent<GateCfg>();
//                             gatecfg.OpenConditionType = m_gateList[i].gateOpenCondId;
//                             gatecfg.OpenCondParamList = m_gateList[i].gateOpenCondParam;
//                             gatecfg.OpenCondCountList = m_gateList[i].gateOpenCondCount;
//                             obj.SetActive(true);
//                             m_gateList[i].OutGateObject = obj;
//                         }
//                     }
//                 }
//                 if (null != m_gateList[i].BridgeData)
//                 {
//                     GameResPackage.AsyncLoadPackageData loadData2 = new GameResPackage.AsyncLoadPackageData();
//                     IEnumerator e2 = m_gateList[i].BridgeData.nextRoomNode.BuildLocatorObj(dataTree.mGateData[i].mNextRoomNode, loadData2);
//                     while (true)
//                     {
//                         e2.MoveNext();
//                         if (loadData2.m_isFinish)
//                         {
//                             break;
//                         }
//                         yield return e2.Current;
//                     }
//                     m_gateList[i].GateToRoomObjID = m_gateList[i].BridgeData.nextRoomNode.m_GUID;
//                     m_gateList[i].GateOpenAnim(false);
//                 }
//                 else
//                 {
//                     m_gateList[i].GateOpenAnim(true);
//                 }
//             }
//            loadData.m_isFinish = true;
        }