示例#1
0
 void Awake()
 {
     if (Application.platform != RuntimePlatform.WebGLPlayer)
     {
         socketIO = gameObject.AddComponent <NativeSocketIO>();
         socketIO.Init(settings);
     }
 }
示例#2
0
        private void Awake()
        {
            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                socket = gameObject.AddComponent <WebGLSocketIO>();
            }
            else
            {
                socket = gameObject.AddComponent <NativeSocketIO>();
            }

            socket.Init(settings);
        }
示例#3
0
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
            }
            else if (instance != null)
            {
                Destroy(gameObject);
            }


            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                socketIO = gameObject.AddComponent <WebGLSocketIO>();
            }
            else
            {
                socketIO = gameObject.AddComponent <NativeSocketIO>();
            }

            socketIO.Init(settings);
        }
示例#4
0
 public void Connect()
 {
     print("CONNECTING");
     socketIO.Init(settings);
     socketIO.Connect();
 }
示例#5
0
 public void ResetSettings()
 {
     socketIO.Init(settings);
 }