public static void Postfix(GameDiscovery __instance) { foreach (var Server in LocalGameServers) { AddServer(__instance, Server.Address, Server.Name); } }
private static void AddServer(GameDiscovery Discovery, string Address, string Name) { var joinGameButton = Object.Instantiate(Discovery.ButtonPrefab, Discovery.ItemLocation); joinGameButton.transform.localPosition = new Vector3(0f, Discovery.YStart + (Discovery.ItemLocation.childCount - 1) * Discovery.YOffset, -1f); joinGameButton.netAddress = Address; joinGameButton.timeRecieved = float.MaxValue; joinGameButton.gameNameText.Text = Name; joinGameButton.GetComponentInChildren <MeshRenderer>().material.SetInt(Globals.MASK, 4); Discovery.received["Xeno://" + Address] = joinGameButton; }
// Use this for initialization void Awake() { singleton = this; //Console.Log("Initialized network"); }