private void removeRoom(SocketIOEvent e) { Debug.Log("Server => removeRoom" + e.data); string data = e.data.ToString(); RoomJSON user = RoomJSON.CreateFromJSON(data); Destroy(uiManger.Rooms[user.name]); }
//=========================================== //=========================================== //=========================================== //MainGame CallBack function //=========================================== private void GameInit(SocketIOEvent e) { Debug.Log("Server => Welcom to the Room of " + ClientStatus.currentingRoom); string data = e.data.ToString(); Debug.Log(data); RoomJSON roomJSON = RoomJSON.CreateFromJSON(data); ClientStatus.currentUUID = roomJSON.currnetUUID; if (gameMangerOBJ == null) { gameMangerOBJ = Instantiate(gameMangerPrefab); } }
public void UpdateRoom(SocketIOEvent e) { string data = e.data.ToString(); RoomJSON roomJSON = RoomJSON.CreateFromJSON(data); var obj = Instantiate(RoomOBJ) as GameObject; obj.transform.SetParent(Scroll_View_Content.transform); RectTransform rectTransform = obj.GetComponent <RectTransform>(); Room room = obj.GetComponent <Room>(); rectTransform.anchoredPosition3D = new Vector3(0, 0, 0); rectTransform.localScale = new Vector3(1, 1, 1); room.uiManger = this; room.Name = roomJSON.name; room.index = roomJSON.index; room.UUID = roomJSON.UUID; //room.currnetUUID.Add(roomJSON.UUID); Rooms.Add(room.Name, obj); }