示例#1
0
 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;
         }
     }
 }
示例#2
0
 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();
 }
示例#3
0
 private void State_SelectMode()
 {
     if (this.ExpandButton("Server"))
     {
         this.state = BoltInit.State.SelectMap;
     }
     if (this.ExpandButton("Client"))
     {
         this.state = BoltInit.State.EnterServerIp;
     }
 }
示例#4
0
 private void State_StartServer()
 {
     BoltLauncher.StartServer(new UdpEndPoint(UdpIPv4Address.Any, (ushort)this.serverPort));
     BoltNetwork.LoadScene(this.map);
     this.state = BoltInit.State.Started;
 }
示例#5
0
 private void State_StartClient()
 {
     BoltLauncher.StartClient(UdpEndPoint.Any);
     BoltNetwork.Connect(new UdpEndPoint(UdpIPv4Address.Parse(this.serverAddress), (ushort)this.serverPort));
     this.state = BoltInit.State.Started;
 }