public static void NotifyOneNewViewAppear(FduClusterView view) { SyncViewIdData data = new SyncViewIdData(); data.id = view.ViewId; data.name = view.gameObject.name; _waitForAssignViewIdList.Add(data); }
//解析需要创建和销毁的数据 并通知对应类完成创建和销毁工作 public override NetworkState.NETWORK_STATE_TYPE Deserialize() { NetworkState.NETWORK_STATE_TYPE state = NetworkState.NETWORK_STATE_TYPE.SUCCESS; string sceneName = BufferedNetworkUtilsClient.ReadString(ref state); int count = BufferedNetworkUtilsClient.ReadInt(ref state); int viewId, assetId, subViewCount, viewObCount; Vector3 position; Quaternion rotation; string path; for (int i = 0; i < count; i++) { viewId = BufferedNetworkUtilsClient.ReadInt(ref state); assetId = BufferedNetworkUtilsClient.ReadInt(ref state); position = BufferedNetworkUtilsClient.ReadVector3(ref state); rotation = BufferedNetworkUtilsClient.ReadQuaternion(ref state); path = BufferedNetworkUtilsClient.ReadString(ref state); ClusterGameObjectCreatePara para = new ClusterGameObjectCreatePara(viewId, assetId, position, rotation, path); viewObCount = BufferedNetworkUtilsClient.ReadInt(ref state); if (viewObCount > 0) { para.viewFrameCount = new Dictionary <int, int>(); for (int j = 0; j < viewObCount; ++j) { int obId = BufferedNetworkUtilsClient.ReadInt(ref state); int obFrameCount = BufferedNetworkUtilsClient.ReadInt(ref state); para.viewFrameCount.Add(obId, obFrameCount); } } subViewCount = BufferedNetworkUtilsClient.ReadInt(ref state); if (subViewCount > 0) { para.subViewId = new List <int>(); para.subViewFrameCount = new List <Dictionary <int, int> >(); } for (int j = 0; j < subViewCount; ++j) { para.subViewId.Add(BufferedNetworkUtilsClient.ReadInt(ref state)); int obCount = BufferedNetworkUtilsClient.ReadInt(ref state); para.subViewFrameCount.Add(new Dictionary <int, int>()); for (int k = 0; k < obCount; ++k) { var oneSubViewData = para.subViewFrameCount[para.subViewFrameCount.Count - 1]; var obId = BufferedNetworkUtilsClient.ReadInt(ref state); var obFrameCount = BufferedNetworkUtilsClient.ReadInt(ref state); oneSubViewData.Add(obId, obFrameCount); } } _waitForCreateList.Add(para); } count = BufferedNetworkUtilsClient.ReadInt(ref state); for (int i = 0; i < count; ++i) { _wairForDestoryList.Add(BufferedNetworkUtilsClient.ReadInt(ref state)); } count = BufferedNetworkUtilsClient.ReadInt(ref state); for (int i = 0; i < count; ++i) { SyncViewIdData data = new SyncViewIdData(); data.name = BufferedNetworkUtilsClient.ReadString(ref state); data.id = BufferedNetworkUtilsClient.ReadInt(ref state); _waitForAssignViewIdList.Add(data); } if (BufferedNetworkUtilsClient.ReadString(ref state) != "FduClusterViewManagerEndFlag") { Debug.LogError("Wrong end of FduClusterViewManagerEndFlag!"); } if (sceneName == UnityEngine.SceneManagement.SceneManager.GetActiveScene().name) { ProcessCreateRequest(); ProcessDestoryRequest(); ProcessAssignViewIdRequest(); } ClearListData(); return(state); }