Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void resetClient()
- {
- try
- {
- Debug.Log(gms.MaxIPNum);
- IPNum = gms.MaxIPNum;
- gms.clients = new List<GameObject>();
- gms.CurrentIPAddresses = new List<string>();
- for (int i = 0; i < IPNum; i++)
- {
- string res = "";
- for (int j = 0; j < 4; i++)
- {
- int a = rand.Next(0, 255);
- res = res + a.ToString() + ".";
- }
- gms.CurrentIPAddresses.Add(res);
- res.Remove(res.Length - 1);
- var instantiatedClient = Instantiate(clientPrefab);
- Client clientScript = instantiatedClient.GetComponent<Client>();
- clientScript.IPAddress = res;
- clientScript.passwordProtected = false;
- gms.clients.Add(instantiatedClient);
- Debug.Log("ran");
- }
- }
- catch (Exception e)
- {
- Debug.LogException(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement