コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="session"></param>
        public static TelemetryGame NewWithGameModeParams(TelemetrySession session)
        {
            var telemetryGame = new TelemetryGame(session);

            telemetryGame.Set("map", GameModeParams.instance.selectedMap);
            telemetryGame.Set("mode", GameModeParams.instance.selectedGameModePrefab.name);
            telemetryGame.Set("playerCount", GameModeParams.instance.playerParams.Count(x => x.isPlaying));
            telemetryGame.Set("rematch", GameModeParams.instance.firstGame ? 0 : 1);

            for (var i = 0; i < GameModeParams.instance.playerParams.Length; ++i)
            {
                var playerParams = GameModeParams.instance.playerParams[i];
                if (!playerParams.isPlaying)
                {
                    continue;
                }

                telemetryGame.Set($"player{i}Char", playerParams.selectedSkin.name);
                telemetryGame.Set($"player{i}Controller", playerParams.controllerIndex);
            }

            Telemetry.FillWithBasicInfo(telemetryGame);

            return(telemetryGame);
        }
コード例 #2
0
 public static void NewGame(Scene scene)
 {
     if (scene.name.StartsWith(GameConstants.MapPrefixe))
     {
         session.Incr("gameCount");
         UnityEngine.Debug.Assert(game == null);
         _game = TelemetryGame.NewWithGameModeParams(session);
     }
 }