2d Game how to make Health And Gameover script a 3 life kind Of health and can it connect to my Reset script
using UnityEngine;
using System.Collections;
public class Reset : MonoBehaviour {
public AudioClip die;
AudioSource aScorce;
GameObject obj;
// Use this for initialization
void Start () {
obj = GameObject.Find ("AudioObject");
if (obj != null)
aScorce = obj.GetComponent<AudioSource> (); // get component once @ Start more efficient.
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D (Collider2D other)
{
if (other.gameObject.CompareTag("Player"))
aScorce.clip = die;
aScorce.Play ();
if (other.gameObject.CompareTag("Player"))
Application.LoadLevel(Application.loadedLevel);
}
}