Example #1
0
    // Update is called once per frame
    private void Update()
    {
        if (((tr.rotation.eulerAngles.x >= 45.0f) && (tr.rotation.eulerAngles.x <= 315.0f)) ||
            ((tr.rotation.eulerAngles.z >= 45.0f) && (tr.rotation.eulerAngles.z <= 315.0f)))
        {
            dead = true;
        }

        if (dead)
        {
            if (!isRespawning)
            {
                OnDeath();
            }
            if (dm.transitionDone)
            {
                Respawn();
                dm.UntoggleEndMenu();
                isRespawning      = false;
                dead              = false;
                dm.transitionDone = false;
            }
        }
    }