Esempio n. 1
0
    IEnumerator StartDeathSequence(float stallTime)
    {
        //stops double death
        if (m_IsDead == true)
        {
            yield break;
        }

        //Set bools and kill velocity so camera stops following robot
        m_IsStunned          = true;
        m_IsDead             = true;
        m_Rigidbody.velocity = Vector3.zero;

        m_OverloadController.EndSpeedBoost();
        m_OverloadController.enabled = false;

        PlayAudio(m_DeathSound);

        //hide visual model without deactivating the entire robot
        HideModel();

        //activate death particle system
        GameManager.m_Singleton.m_EffectsManager.ActivateEffect("PlayerDeath", transform.position);

        yield return(new WaitForSeconds(stallTime));

        OnDeath();
    }