Example #1
0
    private void FinalizeCatching(FinishCatchEvent e)
    {
        if (e.guess == null)
        {
            return;
        }
        GhostController ghostController = e.guess.GetComponent <GhostController>();

        if (ghostController != null && ghostController.enabled)
        {
            if (e.hunter == e.guess)
            {
                Events.g.Raise(new EndGameEvent(winner: Player.NoPlayer, rationale: EndReason.HunterCaughtGhostInSameBody));
            }
            else
            {
                Events.g.Raise(new EndGameEvent(winner: Player.HunterPlayer, rationale: EndReason.HunterCaughtGhost));
            }
        }
        else
        {
            Events.g.Raise(new EndGameEvent(winner: Player.GhostPlayer, rationale: EndReason.HunterCaughtInnocent));
        }
    }
Example #2
0
 private void MarkCatchFinalized(FinishCatchEvent e)
 {
     _catchFinalized = true;
 }