- Home /
(Android) Timer change script help
Hi hope someone can help me, I want it if you press the button that I can change the time but I don't know how to do it :(
Here's the script:
var endTime : float; var textMesh : TextMesh; var keyboard : iPhoneKeyboard; var inputText : String = "text"; var NumberPad = iPhoneKeyboardType.NumberPad;
function Start() { endTime = Time.time + 0; textMesh = GameObject.Find ("Timer").GetComponent(TextMesh); textMesh.text = "0"; }
function Update() { var timeLeft : int = endTime - Time.time; if (timeLeft < 0) timeLeft = 0; textMesh.text = timeLeft.ToString(); }
function OnGUI(){
if(GUI.Button(Rect(10,20,120,50), "Change")){
keyboard = iPhoneKeyboard.Open("Onlynumbers"); textMesh.text = Time.time.ToSring(); }
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Time in unity 2 Answers
Android Game Conversion 1 Answer
Problem with jcar script for android mobile 1 Answer
eulerangle not work with joystick 0 Answers