1,为玩家添加脚本DonePlayerHealth
using UnityEngine;
using System.Collections;
public class DonePlayerHealth : MonoBehaviour
{
public float health = 100f; // How much health the player has left.
public float resetAfterDeathTime = 5f; // How much time from the player dying to the level reseting.
public AudioClip deathClip; // The sound effect of the player dying.
private Animator anim; // Reference to the animator component.
private DonePlayerMovement playerMovement; // Reference to the player movement script.
private DoneHashIDs hash; // Reference to the HashIDs.
private DoneSceneFadeInOut sceneFadeInOut; // Reference to the SceneFadeInOut script.
private DoneLastPlayerSighting lastPlayerSighting; // Reference to the LastPlayerSighting script.
private float timer; // A timer for counting to the reset of the level once the player is