-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUI.cs
More file actions
executable file
·39 lines (30 loc) · 779 Bytes
/
Copy pathUI.cs
File metadata and controls
executable file
·39 lines (30 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using UnityEngine;
using System.Collections;
public class UI : MonoBehaviour {
public GUIStyle ResetStyle;
public GameObject ImageTarget;
public bool ShowResetBtn;
//public bool tempShowResetBtn;
// Use this for initialization
void Start () {
ShowResetBtn = false;
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
float btn = (Screen.height/8.0f); //Unit of Buttons
float sw = Screen.width;
float sh = Screen.height;
float sc_x = Screen.width/2f;
float sc_y = Screen.height/2f;
if(ShowResetBtn)
{
if(GUI.Button(new Rect(0.5f*btn, (sh-2f*btn), (3f*btn), (1.5f*btn)), "Reset", ResetStyle))
{
ImageTarget.GetComponent<LogicControl>().TriggerReset = true;
ShowResetBtn = false;
}
}
}
}