-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimerController.cs
447 lines (375 loc) · 13.7 KB
/
TimerController.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
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
using System;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
// Token: 0x02000216 RID: 534
public class TimerController : MonoBehaviour
{
// Token: 0x06000ABF RID: 2751
public void Start()
{
this.epilepsyMode = true;
this.ActiveScene = SceneManager.GetActiveScene().name;
this.GMObject = GameObject.Find("GameManager");
this.GMScript = this.GMObject.GetComponent<GameManager>();
this.timerGoing = false;
this.LevelAudioSource = GameObject.Find("LevelMusic").GetComponent<AudioSource>();
this.HallwayAudioSource = GameObject.Find("SomethingsWrong").GetComponent<AudioSource>();
this.CutsceneAudioSource = GameObject.Find("TheGirl").GetComponent<AudioSource>();
this.BadEndingAudioSource = GameObject.Find("BadEnding").GetComponent<AudioSource>();
this.MenuAudioSource = GameObject.Find("Theme").GetComponent<AudioSource>();
this.LevelAudioSource.volume = 1f;
this.HallwayAudioSource.volume = 1f;
this.CutsceneAudioSource.volume = 1f;
this.BadEndingAudioSource.volume = 1f;
this.MenuAudioSource.volume = 1f;
this.ThemeMusicObject = GameObject.Find("Theme");
this.TheGirlMusicObject = GameObject.Find("TheGirl");
this.LevelMusicMusicObject = GameObject.Find("LevelMusic");
this.SomethingsWrongMusicObject = GameObject.Find("SomethingsWrong");
this.BadEndingMusicObject = GameObject.Find("BadEnding");
this.ThemeMusicObject.AddComponent<AudioLowPassFilter>();
this.TheGirlMusicObject.AddComponent<AudioLowPassFilter>();
this.LevelMusicMusicObject.AddComponent<AudioLowPassFilter>();
this.SomethingsWrongMusicObject.AddComponent<AudioLowPassFilter>();
this.BadEndingMusicObject.AddComponent<AudioLowPassFilter>();
this.audioLowPass1 = this.ThemeMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass2 = this.TheGirlMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass3 = this.LevelMusicMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass4 = this.SomethingsWrongMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass5 = this.BadEndingMusicObject.GetComponent<AudioLowPassFilter>();
this.PlayerLandObj = GameObject.Find("PlayerLand");
this.PlayerLand = this.PlayerLandObj.GetComponent<AudioSource>();
this.normWidth = Screen.width;
this.normHeight = Screen.height;
if (!this.hasCreatedTimerShit)
{
this.WIBBLE = new GameObject();
this.WIBBLE.name = "SpeedrunCanvas";
this.WIBBLE.AddComponent<Canvas>();
this.TIMERCANVAS = this.WIBBLE.GetComponent<Canvas>();
this.TIMERCANVAS.renderMode = RenderMode.ScreenSpaceOverlay;
this.WIBBLE.AddComponent<CanvasScaler>();
this.CS = this.WIBBLE.GetComponent<CanvasScaler>();
this.CS.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
this.CS.referenceResolution = new Vector2(1280f, 720f);
this.CS.matchWidthOrHeight = 0.5f;
this.WIBBLE.AddComponent<GraphicRaycaster>();
this.TextGO = new GameObject();
this.TextGO.transform.parent = this.WIBBLE.transform;
this.TextGO.name = "WOBBLE";
this.TCTextThing = this.TextGO.AddComponent<TextMeshProUGUI>();
this.TCTextThing.fontSize = 50f;
this.TCTextThing.outlineWidth = 100f;
this.TCTextThing.outlineColor = Color.black;
this.rectTransform = this.TCTextThing.GetComponent<RectTransform>();
this.rectTransform.localPosition = new Vector3(0f, -4.4f, 0f);
this.rectTransform.sizeDelta = new Vector2(800f, 50f);
this.MasterID = new GameObject();
this.MasterID.transform.SetParent(this.TIMERCANVAS.transform);
this.JumpKeyObject = new GameObject();
this.JumpKeyObject.transform.SetParent(this.MasterID.transform);
this.JumpKeyObject.AddComponent<Image>();
this.JumpKey = this.JumpKeyObject.GetComponent<Image>();
this.JumpKey.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, 127);
this.hasCreatedTimerShit = false;
this.isGamePaused = false;
this.AudioMuted = false;
this.TestGOBJECT = new GameObject();
this.TestGOBJECT.transform.SetParent(this.WIBBLE.transform);
this.TestGOBJECT.transform.localPosition = new Vector3(160f, 200f);
this.TestGOBJECT.transform.localScale = new Vector3(1.25f, 1.25f);
this.Hahahaha = new GameObject();
this.Hahahaha.transform.SetParent(this.TestGOBJECT.transform);
this.Hahahaha.transform.localScale = new Vector3(1.25f, 1.25f);
this.Hahahaha.AddComponent<TextMeshProUGUI>();
this.WPressedTMP = this.Hahahaha.GetComponent<TextMeshProUGUI>();
this.WPressedTMP.SetText("L");
this.WPressedTMP.fontSize = 75f;
this.WPressedTMP.transform.localPosition = new Vector3(210f, 180f);
this.WPressedTMP.color = new Color(1f, 1f, 1f);
this.WPressedTMP.outlineWidth = 1f;
this.WPressedTMP.outlineColor = new Color32(0, 0, 0, byte.MaxValue);
this.TestGOBJECT.transform.localScale = new Vector3(0.65f, 0.65f);
this.AButtonObj = new GameObject();
this.AButtonObj.transform.SetParent(this.TestGOBJECT.transform);
this.AButtonObj.AddComponent<TextMeshProUGUI>();
this.AButtonTMP = this.AButtonObj.GetComponent<TextMeshProUGUI>();
this.AButtonTMP.SetText("R");
this.AButtonTMP.fontSize = 62f;
this.AButtonTMP.transform.localPosition = new Vector3(320f, 174f);
this.AButtonTMP.color = new Color(1f, 1f, 1f);
this.AButtonTMP.outlineWidth = 1f;
this.AButtonTMP.outlineColor = new Color32(0, 0, 0, byte.MaxValue);
this.hasCreatedTimerShit = true;
}
this.CS.referenceResolution = new Vector2(1280f, 720f);
}
// Token: 0x06000AC0 RID: 2752
public void Update()
{
this.PlayerLandObj = GameObject.Find("PlayerLand");
this.PlayerLand = this.PlayerLandObj.GetComponent<AudioSource>();
this.LeImage = this.TestGOBJECT.GetComponent<Image>();
this.CS.referenceResolution = new Vector2(1280f, 720f);
this.ActiveScene = SceneManager.GetActiveScene().name;
this.timePlaying = TimeSpan.FromSeconds((double)this.elapsedTime);
this.CS.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
this.TCTextThing.text = Input.GetAxisRaw("Horizontal").ToString();
if (Input.GetKeyDown(KeyCode.P))
{
this.AllEndings = !this.AllEndings;
this.PlayerLand.Play();
}
if (this.ActiveScene == "Level1")
{
this.hasWatchedCutscene = true;
}
if (this.timerGoing)
{
this.elapsedTime += Time.unscaledDeltaTime;
}
if (Input.GetKeyDown(KeyCode.M))
{
this.AudioMuted = !this.AudioMuted;
}
if (!this.AudioMuted)
{
this.LevelAudioSource.volume = 1f;
this.HallwayAudioSource.volume = 1f;
this.CutsceneAudioSource.volume = 1f;
this.BadEndingAudioSource.volume = 1f;
this.MenuAudioSource.volume = 1f;
}
if (this.AudioMuted)
{
this.LevelAudioSource.volume = 0f;
this.HallwayAudioSource.volume = 0f;
this.CutsceneAudioSource.volume = 0f;
this.BadEndingAudioSource.volume = 0f;
this.MenuAudioSource.volume = 0f;
}
if (Input.GetKeyDown(KeyCode.F11))
{
if (!Screen.fullScreen)
{
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true);
}
if (Screen.fullScreen)
{
Screen.SetResolution(this.normWidth, this.normHeight, false);
}
}
this.JumpKeyObject.transform.localPosition = new Vector2(-235f, 335f);
this.TCTextThing.transform.localPosition = new Vector2(-235f, 335f);
this.TCTextThing.alignment = TextAlignmentOptions.MidlineLeft;
UnityEngine.Object.DontDestroyOnLoad(this.WIBBLE);
UnityEngine.Object.DontDestroyOnLoad(this.TestGOBJECT);
if (this.countingEnabled)
{
this.timeCounter += Time.deltaTime;
}
if (this.GMScript.psychoCompleted && !this.PsychoGiven)
{
this.EndingCount++;
this.PsychoGiven = true;
}
if (this.EndingCount == 5)
{
this.EndTimer();
}
this.ThemeMusicObject = GameObject.Find("Theme");
this.TheGirlMusicObject = GameObject.Find("TheGirl");
this.LevelMusicMusicObject = GameObject.Find("LevelMusic");
this.SomethingsWrongMusicObject = GameObject.Find("SomethingsWrong");
this.BadEndingMusicObject = GameObject.Find("BadEnding");
this.audioLowPass1 = this.ThemeMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass2 = this.TheGirlMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass3 = this.LevelMusicMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass4 = this.SomethingsWrongMusicObject.GetComponent<AudioLowPassFilter>();
this.audioLowPass5 = this.BadEndingMusicObject.GetComponent<AudioLowPassFilter>();
if (this.isGamePaused)
{
this.audioLowPass1.cutoffFrequency = 250f;
this.audioLowPass2.cutoffFrequency = 250f;
this.audioLowPass3.cutoffFrequency = 250f;
this.audioLowPass4.cutoffFrequency = 250f;
this.audioLowPass5.cutoffFrequency = 250f;
}
if (!this.isGamePaused)
{
this.audioLowPass1.cutoffFrequency = 99999f;
this.audioLowPass2.cutoffFrequency = 99999f;
this.audioLowPass3.cutoffFrequency = 99999f;
this.audioLowPass4.cutoffFrequency = 99999f;
this.audioLowPass5.cutoffFrequency = 99999f;
}
if (Input.GetAxisRaw("Horizontal") == 1f)
{
this.AButtonTMP.color = Color.HSVToRGB(this.ColorNEW, 1f, 1f);
}
if (Input.GetAxisRaw("Horizontal") < 1f)
{
this.AButtonTMP.color = new Color(1f, 1f, 1f);
}
if (Input.GetAxisRaw("Horizontal") == -1f)
{
this.WPressedTMP.color = Color.HSVToRGB(this.ColorNEW, 1f, 1f);
}
if (Input.GetAxisRaw("Horizontal") > -1f)
{
this.WPressedTMP.color = new Color(1f, 1f, 1f);
}
if (this.ColorNEW >= 1f)
{
this.ColorNEW = 0f;
}
this.ColorNEW += Time.deltaTime * 0.1f;
}
// Token: 0x06000AC2 RID: 2754
public void EndTimer()
{
this.timerGoing = false;
}
// Token: 0x06000AC3 RID: 2755
public void Awake()
{
}
// Token: 0x04000D6D RID: 3437
public float inGameTime;
// Token: 0x04000D6E RID: 3438
public float GameStartTime;
// Token: 0x04000D6F RID: 3439
public float frozenGameTime;
// Token: 0x04000D70 RID: 3440
public GameObject GMObject;
// Token: 0x04000D71 RID: 3441
public GameManager GMScript;
// Token: 0x04000D72 RID: 3442
public bool timerGoing;
// Token: 0x04000D73 RID: 3443
public float elapsedTime;
// Token: 0x04000D74 RID: 3444
public TimeSpan timePlaying;
// Token: 0x04000D75 RID: 3445
public bool AllEndings;
// Token: 0x04000D76 RID: 3446
public string ActiveScene;
// Token: 0x04000D77 RID: 3447
public bool hasWatchedCutscene;
// Token: 0x04000D78 RID: 3448
public AudioSource LevelAudioSource;
// Token: 0x04000D79 RID: 3449
public AudioSource HallwayAudioSource;
// Token: 0x04000D7A RID: 3450
public AudioSource CutsceneAudioSource;
// Token: 0x04000D7B RID: 3451
public AudioSource BadEndingAudioSource;
// Token: 0x04000D7C RID: 3452
public AudioSource MenuAudioSource;
// Token: 0x04000D7D RID: 3453
public bool AudioMuted;
// Token: 0x04000D7E RID: 3454
public int normWidth;
// Token: 0x04000D7F RID: 3455
public int normHeight;
// Token: 0x04000D80 RID: 3456
public GameObject WIBBLE;
// Token: 0x04000D81 RID: 3457
public Canvas TIMERCANVAS;
// Token: 0x04000D82 RID: 3458
public GameObject TextGO;
// Token: 0x04000D83 RID: 3459
public TextMeshProUGUI TCTextThing;
// Token: 0x04000D84 RID: 3460
public RectTransform rectTransform;
// Token: 0x04000D85 RID: 3461
public string hours;
// Token: 0x04000D86 RID: 3462
public string minutes;
// Token: 0x04000D87 RID: 3463
public string seconds;
// Token: 0x04000D88 RID: 3464
public string ms;
// Token: 0x04000D89 RID: 3465
public CanvasScaler CS;
// Token: 0x04000D8A RID: 3466
public int EndingCount;
// Token: 0x04000D8B RID: 3467
public bool AwakeGiven;
// Token: 0x04000D8C RID: 3468
public bool BLGiven;
// Token: 0x04000D8D RID: 3469
public bool PuppetGiven;
// Token: 0x04000D8E RID: 3470
public bool ILGiven;
// Token: 0x04000D8F RID: 3471
public bool PsychoGiven;
// Token: 0x04000D90 RID: 3472
public float timeCounter;
// Token: 0x04000D91 RID: 3473
public bool countingEnabled;
// Token: 0x04000D92 RID: 3474
public GameObject FADEPANEL;
// Token: 0x04000D93 RID: 3475
public PsychopathEndingController laPEC;
// Token: 0x04000D94 RID: 3476
public bool hasCreatedTimerShit;
// Token: 0x04000D95 RID: 3477
public AudioLowPassFilter audioLowPass1;
// Token: 0x04000D96 RID: 3478
public AudioLowPassFilter audioLowPass2;
// Token: 0x04000D97 RID: 3479
public AudioLowPassFilter audioLowPass3;
// Token: 0x04000D98 RID: 3480
public AudioLowPassFilter audioLowPass4;
// Token: 0x04000D99 RID: 3481
public AudioLowPassFilter audioLowPass5;
// Token: 0x04000D9A RID: 3482
public GameObject ThemeMusicObject;
// Token: 0x04000D9B RID: 3483
public GameObject TheGirlMusicObject;
// Token: 0x04000D9C RID: 3484
public GameObject LevelMusicMusicObject;
// Token: 0x04000D9D RID: 3485
public GameObject SomethingsWrongMusicObject;
// Token: 0x04000D9E RID: 3486
public GameObject BadEndingMusicObject;
// Token: 0x04000D9F RID: 3487
public bool epilepsyMode;
// Token: 0x04000DA0 RID: 3488
public bool isGamePaused;
// Token: 0x04000DA1 RID: 3489
public GameObject MasterID;
// Token: 0x04000DA2 RID: 3490
public GameObject JumpKeyObject;
// Token: 0x04000DA3 RID: 3491
public Image JumpKey;
// Token: 0x04000DA4 RID: 3492
public RectTransform secondRT;
// Token: 0x04000DA5 RID: 3493
public GameObject TestGOBJECT;
// Token: 0x04000DA6 RID: 3494
public Image LeImage;
// Token: 0x04000DA7 RID: 3495
public bool WPressed;
// Token: 0x04000DA8 RID: 3496
public TextMeshProUGUI WPressedTMP;
// Token: 0x04000DA9 RID: 3497
public GameObject Hahahaha;
// Token: 0x04000DAA RID: 3498
public GameObject AButtonE;
// Token: 0x04000DAB RID: 3499
public Image AButtonImageE;
// Token: 0x04000DAC RID: 3500
public GameObject AButtonObj;
// Token: 0x04000DAD RID: 3501
public TextMeshProUGUI AButtonTMP;
// Token: 0x04000DAE RID: 3502
public float ColorNEW;
// Token: 0x04000DF1 RID: 3569
public GameObject PlayerLandObj;
// Token: 0x04000DF2 RID: 3570
public AudioSource PlayerLand;
}