Beispiel #1
0
    private void CheckForPhaseChange()
    {
        if (AscensionLevel.Value != AscensionLevelForNextPhase)
        {
            DebugMessage("Cannot ascend; AscensionLevel = " + AscensionLevel.Value + ", AscensionLevelForNextPhase = " + AscensionLevelForNextPhase);
            return;
        }

        DebugMessage("Ascension occurring!");

        // Instantiate the ascension effect...
        if (!string.IsNullOrEmpty(AscensionEffectPath))
        {
            GameObject ascensionEffect = Resources.Load <GameObject>(AscensionEffectPath);
            Instantiate(ascensionEffect, transform.position, transform.rotation);
        }

        // TODO: Implement a player object pooling manager...
        MatchEntityManager.InactivatePlayerAvatar(gameObject, PlayerState);

        if (!string.IsNullOrEmpty(NextPlayerModelName))
        {
            MatchEntityManager.SwitchToNewPlayerAvatar(transform.position, transform.rotation, NextPlayerModelName);
        }
    }
Beispiel #2
0
    private void CheckForFailure(Collider who)
    {
        if (!TagsThatCauseDeath.Contains(who.tag))
        {
            return;
        }

        // The thing that collided with us does, in fact, cause death.
        MatchEntityManager.InactivatePlayerAvatar(gameObject, PlayerState);
        MatchEntityManager.SpawnMob(transform.position, transform.rotation, DeathModelName);

        // TODO: Short delay, music change, then show failure UI.
        GameUIController.ShowFailureUI();
    }