Hey, thanks for clicking on this.
I want to have a unique highscore system for my android game and what I want happening is:
-a GUI button or something similar that takes a screenshot to appear on screen when the time scale is 0
-and also another button/something similar that reloads the level
Thank you very much, please keep in mind that I am new to all this…
Maybe not exactly what you need, but this code was written exclusively for me to resolve your issue, Dude:
//CRIADO POR RAFAEL MARIANO PAIVA
//NAO SOMOS TODOS MACACOS, SOMOS TODOS A IMAGEM E SEMELHANÇA DE DEUS!
using UnityEngine;
using System.Collections;
public class CountTime : MonoBehaviour {
public float time = 10f; // Set your time.
public GameObject screenshotImage; // Set your image(Sprite Renderer, etc,...).
public int NumberStage; // Set your Stage.
void Start () {
//This is obsolete, but it works.
screenshotImage.active = false;
}
void Update () {
time -= Time.deltaTime;
int myInt = (int)time;
}
void OnGUI(){
int myInt = (int)time;
GUI.Box(new Rect(Screen.width/2,Screen.height/2,100,25),myInt.ToString());
if(myInt == 0 )
{
time = 0;
//This is obsolete, but it works.
screenshotImage.active = true;
Debug.Log("STOP!");
if(GUI.Button(new Rect(Screen.width/2 - 30,Screen.height/3,165,30),"Reload Stage!")){
Application.LoadLevel(NumberStage);
}
}
}
}