private bool onRemovePlayer(TiltATubesEvents.RemovePlayer evt) { if (PlatformVolumeId == evt.VolumeId) { GameObject playerGameObj = evt.PlayerGameObj; string playerName = getPlayerName(playerGameObj); if (activePlayers.Contains(playerName)) { activePlayers.Remove(playerName); if (!finishedPlayers.Contains(playerName)) { finishedPlayers.Add(playerName); } if (playerName == localPlayerName) { setUIVisibility(isVisible: true); } if (isGameActive) { playAudioEvent(PlayerFalls, AudioAnchor); } MiniGameUtils.StopBiTimer("tiltotubes"); } } return(false); }
private bool onAddPlayer(TiltATubesEvents.AddPlayer evt) { if (PlatformVolumeId == evt.VolumeId) { GameObject playerGameObj = evt.PlayerGameObj; string playerName = getPlayerName(playerGameObj); if (!isGameActive) { if (activePlayers.Add(playerName) && playerName == localPlayerName && isPlayerActive(localPlayerName)) { setUIVisibility(isVisible: false); didLocalPlayerParticipate = true; closeTray(); CoroutineRunner.Start(setSlideLocomotion(1.5f, playerGameObj), this, "forceIntoTube"); MiniGameUtils.StartBiTimer("tiltotubes"); MiniGameUtils.LogGameStartBi("tiltotubes"); } if (finishedPlayers.Contains(playerName)) { finishedPlayers.Remove(playerName); } } } return(false); }