forked from adenlb/Vivid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_Manager.cs
59 lines (49 loc) · 1.31 KB
/
GUI_Manager.cs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class GUI_Manager : MonoBehaviour {
public bool enabled;
public Light lite;
public Image reticle;
public Image color_checker;
public Sprite reticleNorm;
public Sprite reticleClick;
public Sprite no_lens;
public Sprite red_lens;
public Sprite blue_lens;
public Sprite green_lens;
void Start () {
if (enabled) {
reticle.sprite = reticleNorm;
color_checker.sprite = no_lens;
}
}
// Update is called once per frame
void LateUpdate () {
if (enabled) {
if (Input.GetMouseButton (0)) {
reticle.sprite = reticleClick;
} else {
reticle.sprite = reticleNorm;
}
if (lite.color == Color.white) {
color_checker.sprite = no_lens;
} else if (lite.color == Color.red) {
color_checker.sprite = red_lens;
} else if (lite.color == Color.green) {
color_checker.sprite = green_lens;
} else if (lite.color == Color.blue) {
color_checker.sprite = blue_lens;
}
if (Input.GetKeyDown (KeyCode.C)) {
color_checker.sprite = red_lens;
} else if (Input.GetKeyDown (KeyCode.V)) {
color_checker.sprite = blue_lens;
} else if (Input.GetKeyDown (KeyCode.B)) {
color_checker.sprite = green_lens;
} else if (Input.GetKeyDown (KeyCode.N)) {
color_checker.sprite = no_lens;
}
}
}
}