private void State_SelectMap() { foreach (string current in BoltScenes.AllScenes) { if (Application.loadedLevelName != current && this.ExpandButton(current)) { this.map = current; this.state = BoltInit.State.StartServer; } } }
private void State_EnterServerIp() { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label("Server IP: ", new GUILayoutOption[0]); this.serverAddress = GUILayout.TextField(this.serverAddress, new GUILayoutOption[0]); if (GUILayout.Button("Connect", new GUILayoutOption[0])) { this.state = BoltInit.State.StartClient; } GUILayout.EndHorizontal(); }
private void State_SelectMode() { if (this.ExpandButton("Server")) { this.state = BoltInit.State.SelectMap; } if (this.ExpandButton("Client")) { this.state = BoltInit.State.EnterServerIp; } }
private void State_StartServer() { BoltLauncher.StartServer(new UdpEndPoint(UdpIPv4Address.Any, (ushort)this.serverPort)); BoltNetwork.LoadScene(this.map); this.state = BoltInit.State.Started; }
private void State_StartClient() { BoltLauncher.StartClient(UdpEndPoint.Any); BoltNetwork.Connect(new UdpEndPoint(UdpIPv4Address.Parse(this.serverAddress), (ushort)this.serverPort)); this.state = BoltInit.State.Started; }