private void OnReceivedMessage(byte[] data, ClientDataContainer clientData) { Debug.Log("new"); GameObject obj = Instantiate(ClientUIPrefab, ContentPanel.transform); ClientUIController uIController = obj.GetComponent <ClientUIController>(); uIController.Initialize(server, clientData); clientUIs.Add(uIController); }
public void UpdateUI() { clientUIs.ForEach((ui) => Destroy(ui.gameObject)); clientUIs.Clear(); server.ClientDataList.ForEach((client) => { Debug.Log("new"); GameObject obj = Instantiate(ClientUIPrefab, ContentPanel.transform); ClientUIController uIController = obj.GetComponent <ClientUIController>(); uIController.Initialize(server, client); clientUIs.Add(uIController); }); }