hi guys i want to create a really basic game over and pause screen and i don’t have a clue on how to start it can someone help me?
the game over screen it’s for when the character die, and if it’s possible a mission complete screen when i walk in a certain spot/place
using this script for player’s health
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public int MaxHealth = 100 ;
public int CurHealth = 100;
public Texture2D lifebar;
public Texture2D lifebar2;
public float HealthBarLenght;
// Use this for initialization
void Start () {
HealthBarLenght = Screen.width / 4;
}
// Update is called once per frame
void Update () {
AdjustCurrentHealth(0);
}
void OnGUI() {
GUI.DrawTexture(new Rect(10, 15, HealthBarLenght, 20), lifebar);
GUI.Box(new Rect(10, 15, HealthBarLenght, 20), CurHealth + "/" + MaxHealth);
GUI.Box(new Rect(10, 15, 300, 20), lifebar2);
}
public void AdjustCurrentHealth(int adj) {
CurHealth += adj;
if(CurHealth < 0)
CurHealth = 0;
if(CurHealth > MaxHealth)
CurHealth = MaxHealth;
if(MaxHealth < 1 )
MaxHealth = 1;
HealthBarLenght = (Screen.width / 4) * (CurHealth / (float)MaxHealth);
}
}