void PlayerCheckHealth() { if (p_health <= 0) { p_anim.Die(); if (isAlive && WaitDeath <= 0) { _canvas.GetComponent <FadeScript>().FadeToLevel(6); isAlive = false; } else { WaitDeath -= Time.deltaTime; } } }
public void Die() { SaveData.AddValueInt("DeathTime", 1); SaveData.AddValueInt("PlayerInGame", -1); _dead = true; _myAnimations.Die(); if (SaveData.ReadValueInt("PlayerInGame") == 0) { Instantiate(death, transform.position, Quaternion.identity); CameraController.Death(); QuadController.Death(); PreLaserScript.Death(); Money.Death(); StartCoroutine("wait"); } }