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));
 }
Ejemplo n.º 2
0
    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();
            }
        }
    }
Ejemplo n.º 3
0
    // 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;
    }
Ejemplo n.º 4
0
 public void OnPlayerDeath(object sender, EventArgs e)
 {
     PlayerDeathHandler?.Invoke(sender, e);
 }
Ejemplo n.º 5
0
 void Start()
 {
     deathHandler = FindObjectOfType <PlayerDeathHandler>();
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     sawblade           = FindObjectOfType <SawBlade>();
     playerdeathHandler = FindObjectOfType <PlayerDeathHandler>();
 }
 private void Awake()
 {
     myDeathHandler = GetComponent <PlayerDeathHandler>();
 }