Exemplo n.º 1
0
    public void connect(Server server, String messageHandlerObject)
    {
        Log.log(TAG, "Connecting to " + server.ip + " - " + server.port);
#if UNITY_EDITOR || UNITY_STANDALONE
        if (session == null)
        {
            session = new MobileClient();
        }
        session.connect(server, new GlobalMessageHandler());
#elif UNITY_ANDROID
        if (androidSession == null)
        {
            androidSession = new AndroidJavaObject("vn.gg.core.MobileClient");
        }
        androidSession.Call("connect", new object[] { server.ip, server.port });
#endif
        setMessageHandlerObject(messageHandlerObject);
    }