public PlayerExitSystem(Contexts contexts, int matchId, PlayerDeathHandler playerDeathHandler, MatchRemover matchRemover) : base(contexts.input) { gameContext = contexts.game; alivePlayerAndBotsGroup = gameContext.GetGroup(GameMatcher.Player); this.matchId = matchId; this.playerDeathHandler = playerDeathHandler; this.matchRemover = matchRemover; alivePlayersGroup = contexts.game.GetGroup( GameMatcher.AllOf(GameMatcher.Player). NoneOf(GameMatcher.KilledBy, GameMatcher.Bot)); }
private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { PlayerDeathHandler deathHandler = other.GetComponentInChildren <PlayerDeathHandler>(); if (deathHandler == null) { Debug.LogError("Player is missing PlayerDeathHandlerComponent"); } else { deathHandler.TransitionPlayerBackToCheckpoint(); } } }
// Start is called before the first frame update void Start() { playerInputPermission = new InputPermission(); playerInputPermission.enable = true; playerInputHandler.SetPermissionProvider(playerInputPermission); playerDeathHandler = new PlayerDeathHandler(this); player.deathHandler = playerDeathHandler; deathTriggerVolumeHandler = new DeathTriggerVolumeHandler(); foreach (var volume in deathTriggerVolumes) { volume.handler = deathTriggerVolumeHandler; } winTriggerVolumeHandler = new WinTriggerVolumeHandler(this); winTriggerVolume.handler = winTriggerVolumeHandler; }
public void OnPlayerDeath(object sender, EventArgs e) { PlayerDeathHandler?.Invoke(sender, e); }
void Start() { deathHandler = FindObjectOfType <PlayerDeathHandler>(); }
// Use this for initialization void Start() { sawblade = FindObjectOfType <SawBlade>(); playerdeathHandler = FindObjectOfType <PlayerDeathHandler>(); }
private void Awake() { myDeathHandler = GetComponent <PlayerDeathHandler>(); }