So i have a “Main Menu” when you click “play” it takes you to a Level selector Screen with all the levels, and you can click on any level and play it. When u play a Level you have 5 heart’s that you go threw and if u have zero heart’s it restarts the level.
HOW DO I MAKE IT SO WHEN YOU ARE AT 0 HEART’S IT takes 1 out of 3 golden hearts away, and when u have 0 golden hearts you can’t play until the golden hearts regenerate. 1 golden heart takes 20 min to generate. BUT I ONLY WANT THE GOLDEN HEARTS TO APPEAR ON THE LEVEL SELECT SCREEN.
heres my code in #c for the level 5 hearts:
using UnityEngine;
using System.Collections;
public class EnemyDamage : MonoBehaviour {
public GameManager gameMananger;
int damageValue = 1;
void OnTriggerEnter(Collider col){
if(col.gameObject.tag == "Player"){
gameMananger.SendMessage("PlayerDamaged", damageValue, SendMessageOptions.DontRequireReceiver);
}
}
}
Also here my Level select Screen in #c
/// /// Level Select. /// Attached to Main Camera /// using UnityEngine; using System.Collections;
public class LevelSelect : MonoBehaviour {
public Texture backgroundTexture;
void OnGUI(){
//Display our Background Texture
GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), backgroundTexture);
//Displays our Buttons
if (GUI.Button (new Rect (Screen.width * .1f, Screen.height * .15f, Screen.width * .1f, Screen.height * .1f), "1")) {
print ("Clicked 1");
UnityEngine.Application.LoadLevel("Level1");
}
if (GUI.Button (new Rect (Screen.width * .2f, Screen.height * .15f, Screen.width * .1f, Screen.height * .1f), "2")) {
print ("Clicked 2");
}
}
}
What do i add to make these changes or how do i make a new script for those new changes?