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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
using UnityEngine;
using System.Collections;
public class DemoControls : MonoBehaviour {
public GameObject Setup1;
public GameObject Setup1Extra;
public Color Setup1Ambient;
public GameObject Setup2;
public GameObject Setup2Extra;
public Color Setup2Ambient;
public GameObject Setup3;
public GameObject Setup3Extra;
public Color Setup3Ambient;
public bool Toggle;
// Use this for initialization
void Start () {
Swap(1);
}
void Swap(int number){
switch(number){
case(1):{
Setup1.SetActive(true);
Setup2.SetActive(false);
if(Setup3)Setup3.SetActive(false);
if(Setup1Extra) Setup1Extra.SetActive(true);
if(Setup2Extra) Setup2Extra.SetActive(false);
if(Setup3Extra) Setup3Extra.SetActive(false);
RenderSettings.ambientLight = Setup1Ambient;
}break;
case(2):{
Setup1.SetActive(false);
Setup2.SetActive(true);
if(Setup3)Setup3.SetActive(false);
if(Setup1Extra) Setup1Extra.SetActive(false);
if(Setup2Extra) Setup2Extra.SetActive(true);
if(Setup3Extra) Setup3Extra.SetActive(false);
RenderSettings.ambientLight = Setup2Ambient;
}break;
case(3):{
Setup1.SetActive(false);
Setup2.SetActive(false);
if(Setup3)Setup3.SetActive(true);
if(Setup1Extra) Setup1Extra.SetActive(false);
if(Setup2Extra) Setup2Extra.SetActive(false);
if(Setup3Extra) Setup3Extra.SetActive(true);
RenderSettings.ambientLight = Setup3Ambient;
}break;
}
}
public bool hideGUI;
public ProFlareBatch batchLeft;
public ProFlareBatch batchRight;
void Update(){
if(Input.GetKeyUp("1")){
Swap(1);
}
if(Input.GetKeyUp("2")){
Swap(2);
}
if(batchLeft&&batchRight){
if(Input.GetKeyUp(KeyCode.M)){
batchLeft.VR_Depth = batchLeft.VR_Depth+0.05f;
batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
batchRight.VR_Depth = batchLeft.VR_Depth;
}
if(Input.GetKeyUp(KeyCode.N)){
batchLeft.VR_Depth = batchLeft.VR_Depth-0.05f;
batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
batchRight.VR_Depth = batchLeft.VR_Depth;
}
}
}
void OnGUI(){
if(hideGUI)
return;
#if UNITY_5
Rect texRect = new Rect(0,GetComponent<Camera>().pixelRect.height-120,GetComponent<Camera>().pixelRect.width,120);
GUI.color = Color.white;
GUI.DrawTexture(texRect, Black);
GUIStyle LogoStyle = new GUIStyle();
LogoStyle.active.background = Logo;
LogoStyle.normal.background = Logo;
LogoStyle.richText = true;
LogoStyle.alignment = TextAnchor.MiddleCenter;
LogoStyle.normal.textColor = Color.white;
GUIStyle style = new GUIStyle();
style.active.background = Button1;
style.normal.background = Button1;
style.richText = true;
style.alignment = TextAnchor.MiddleCenter;
style.normal.textColor = Color.white;
GUIStyle style2 = new GUIStyle();
style2.active.background = Button2;
style2.normal.background = Button2;
style2.richText = true;
style2.alignment = TextAnchor.MiddleCenter;
style2.normal.textColor = Color.white;
GUIStyle style3 = new GUIStyle();
style3.active.background = Button3;
style3.normal.background = Button3;
style3.richText = true;
style3.alignment = TextAnchor.MiddleCenter;
style3.normal.textColor = Color.white;
GUIStyle style4 = new GUIStyle();
style4.active.background = INFO;
style4.normal.background = INFO;
style4.richText = true;
style4.alignment = TextAnchor.MiddleCenter;
style4.normal.textColor = Color.white;
if(GUI.Button(new Rect(20,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",LogoStyle)){
Application.OpenURL("http://proflares.com/store");
}
if(GUI.Button(new Rect(20+Button1.width,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style)){
Swap(1);
}
if(GUI.Button(new Rect(0+Button1.width*2,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style2)){
Swap(2);
}
if(GUI.Button(new Rect(0+Button1.width*3,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style3)){
Swap(3);
}
if(GUI.Button(new Rect(0+Button1.width*4,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style4)){
}
#else
Rect texRect = new Rect(0,GetComponent<Camera>().pixelRect.height-120,GetComponent<Camera>().pixelRect.width,120);
GUI.color = Color.white;
GUI.DrawTexture(texRect, Black);
GUIStyle LogoStyle = new GUIStyle();
LogoStyle.active.background = Logo;
LogoStyle.normal.background = Logo;
LogoStyle.richText = true;
LogoStyle.alignment = TextAnchor.MiddleCenter;
LogoStyle.normal.textColor = Color.white;
GUIStyle style = new GUIStyle();
style.active.background = Button1;
style.normal.background = Button1;
style.richText = true;
style.alignment = TextAnchor.MiddleCenter;
style.normal.textColor = Color.white;
GUIStyle style2 = new GUIStyle();
style2.active.background = Button2;
style2.normal.background = Button2;
style2.richText = true;
style2.alignment = TextAnchor.MiddleCenter;
style2.normal.textColor = Color.white;
GUIStyle style3 = new GUIStyle();
style3.active.background = Button3;
style3.normal.background = Button3;
style3.richText = true;
style3.alignment = TextAnchor.MiddleCenter;
style3.normal.textColor = Color.white;
GUIStyle style4 = new GUIStyle();
style4.active.background = INFO;
style4.normal.background = INFO;
style4.richText = true;
style4.alignment = TextAnchor.MiddleCenter;
style4.normal.textColor = Color.white;
if(GUI.Button(new Rect(20,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",LogoStyle)){
Application.OpenURL("http://proflares.com/store");
}
if(GUI.Button(new Rect(20+Button1.width,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style)){
Swap(1);
}
if(GUI.Button(new Rect(0+Button1.width*2,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style2)){
Swap(2);
}
if(GUI.Button(new Rect(0+Button1.width*3,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style3)){
Swap(3);
}
if(GUI.Button(new Rect(0+Button1.width*4,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style4)){
}
#endif
}
public Texture2D Black;
public Texture2D Logo;
public Texture2D Button1;
public Texture2D Button2;
public Texture2D Button3;
public Texture2D INFO;
void drawTexture(float x, float y, Texture2D texture) {
if(texture != null){
Rect texRect = new Rect(x,y,texture.width,texture.height);
GUI.color = Color.white;
GUI.DrawTexture(texRect, texture);
}
}
}
|