コード例 #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));
        }
    }
コード例 #2
0
ファイル: HunterController.cs プロジェクト: PcloD/MadMansion
 private void MarkCatchFinalized(FinishCatchEvent e)
 {
     _catchFinalized = true;
 }