Example #1
0
    private void Die()
    {
        timeDistortion  = 1f;
        scoreMultiplier = 1f;
        Time.timeScale  = 1f;
        isDead          = true;
        directionArrow.gameObject.SetActive(false);

        movementManager.DisableMovement();

        Instantiate(deathEffect, transform.position, transform.rotation);
        gameObject.GetComponent <SphereCollider>().enabled = false;
        if (aspect != null)
        {
            aspect.GetComponent <MeshRenderer>().enabled = false;
        }

        ParticleSystem[] effects = skillManager.skillSpawn.GetComponentsInChildren <ParticleSystem>();
        int length = effects.Length;

        for (int i = 0; i < length; i++)
        {
            Destroy(effects[i].gameObject);
        }

        dangerZoneCount = 0;
        gravityFieldsGens.Clear();

        if (level.category == Level.LevelCategory.ENDLESS)
        {
            BroadcastStats();
        }

        gameMode.EndSession();
    }