private static void HandleBattlePlayerFullyCharged(BattlePlayer battlePlayer)
        {
            Player player = PlayerSpawner.GetPlayerFor(battlePlayer);

            if (player == null || player.Input == null)
            {
                return;
            }

            VibrateInputDevice(player.Input, kFullyChargedVibrationAmount, kFullyChargedVibrationDuration);
        }
Ejemplo n.º 2
0
        private void FilterNonHumanPlayers(BattlePlayer battlePlayer)
        {
            var player = PlayerSpawner.GetPlayerFor(battlePlayer);

            if (player == null || player.IsAI)
            {
                return;
            }

            event_.Invoke();
        }
Ejemplo n.º 3
0
        private void HandleUpdate()
        {
            ICollection <BattlePlayer> activePlayersInArea = ArenaManager.Instance.LoadedArena.KingOfTheHillArea.ActivePlayers;

            if (activePlayersInArea.Count <= 0 || activePlayersInArea.Count > 1)
            {
                return;
            }

            var playerCollectingScore = PlayerSpawner.GetPlayerFor(activePlayersInArea.First());

            timeSpentInArea_[playerCollectingScore] = timeSpentInArea_.GetValueOrDefault(playerCollectingScore) + Time.deltaTime;
            OnAnyScoreChanged.Invoke();
            CheckIfPlayerWon(playerCollectingScore);
        }
Ejemplo n.º 4
0
 public static bool IsHuman(BattlePlayer battlePlayer)
 {
     return(!PlayerSpawner.GetPlayerFor(battlePlayer).IsAI);
 }
Ejemplo n.º 5
0
        // PRAGMA MARK - Public Interface
        public static void FocusOnPlayer(int playerNumber)
        {
            // passed in 1-indexed
            int playerIndex = playerNumber - 1;

            if (playerIndex < 0 || playerIndex >= RegisteredPlayers.AllPlayers.Count)
            {
                return;
            }

            Player player = RegisteredPlayers.AllPlayers[playerIndex];

            BattleCamera.Instance.SetTransformsOfInterest(PlayerSpawner.AllSpawnedBattlePlayers.Where(bp => PlayerSpawner.GetPlayerFor(bp) == player).Select(bp => bp.transform).ToArray(), debug: true);
        }