Ejemplo n.º 1
0
        /// <summary>
        /// Gets the maximum number of players allowed for the specified match type.
        /// </summary>
        /// <returns>The max players allowed.</returns>
        /// <param name="matchType">Match type.</param>
        public static uint GetMaxPlayersAllowed(MatchType matchType)
        {
            switch (matchType)
            {
            case MatchType.RealTime:
                    #if UNITY_ANDROID
                // https://developers.google.com/games/services/common/concepts/realtimeMultiplayer
                return(8);
                    #elif UNITY_IOS
                return(GKMatchRequest.MaxPlayersAllowedForMatchType(matchType.ToGKMatchType()));
                    #else
                return(0);
                    #endif

            case MatchType.TurnBased:
                    #if UNITY_ANDROID && EM_GPGS
                // https://developers.google.com/games/services/common/concepts/turnbasedMultiplayer
                return(8);
                    #elif UNITY_IOS
                return(GKMatchRequest.MaxPlayersAllowedForMatchType(matchType.ToGKMatchType()));
                    #else
                return(0);
                    #endif

            case MatchType.Unknown:
            default:
                return(0);
            }
        }