Ejemplo n.º 1
0
 private void OnGUI()
 {
     GUILayout.Label("ConnectState: " + EnumUtils.EnumToString(ClientSocket.ConnectState));
     if (!IsConnect && GUILayout.Button("Connect Server"))
     {
         IsConnect = true;
         ClientSocket.Start();
     }
     else if (IsConnect && GUILayout.Button("Close Client"))
     {
         IsConnect = false;
         ClientSocket.Stop();
         ClientSocket = new NetworkCSharpClient("127.0.0.1", 9898);
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     ClientSocket = new NetworkCSharpClient("127.0.0.1", 9898);
     NetworkEventHandler.Instance.Initialize();
     // NetworkCommandHandler.Instance.Initialize();
 }