示例#1
0
        void Awake()
        {
            ClientProvider.SetAccountId(AccountId);
            ClientProvider.SetApplicationName(ApplicationName);

            if (ServerEndpoints.Any())
            {
                ClientProvider.SetServerEndpoint(ServerEndpoints);
            }

            if (AuthenticationPlugin)
            {
                ClientProvider.ActivateAuthenticationPlugin();
            }
            if (MatchmakingPlugin)
            {
                ClientProvider.ActivateMatchmakingPlugin();
            }
            if (TransactionBrokerPlugin)
            {
                ClientProvider.ActivateTransactionBrokerPlugin();
            }

            if (ServerClockPlugin)
            {
                ClientProvider.ActivateServerClockPlugin();
            }

            if (LeaderboardPlugin)
            {
                ClientProvider.ActivateLeaderboardPlugin();
            }

            if (ChatPlugin)
            {
                ClientProvider.ActivateChatPlugin();
            }

            if (FriendsPlugin)
            {
                ClientProvider.ActivateFriendsPlugin();
            }

            if (ClientSettings)
            {
                ClientProvider.ActivateClientSettingsPlugin();
            }

            if (GameVersion)
            {
                ClientProvider.ActivateGameVersionPlugin();
            }

            if (DebugLog)
            {
                ClientProvider.ActivateDebugLog();
            }

            if (OnDisconnected != null)
            {
                ClientProvider.OnDisconnected += (s => MainThread.Post(() => OnDisconnected.Invoke(s)));
            }
        }