-
Notifications
You must be signed in to change notification settings - Fork 5
/
Tool_QuickStart.cs
3776 lines (3390 loc) · 386 KB
/
Tool_QuickStart.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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System;
using UnityEditor.SceneManagement;
using UnityEditorInternal;
using UnityEditor;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine;
using TMPro;
using UnityEngine.Networking;
public class Tool_QuickStart : EditorWindow
{
//Version
string _Version = "V1.4.3";
string _UpdateDate = "11-sep-2023";
//Navigation Tool
int _MenuID = 0; // QuickStart/Scripts/QuickUI/Scene
int _DimensionID = 0; // 2D/3D
int _Type2DID = 0; // Platformer/TopDown/VisualNovel
int _Type3DID = 0; // FPS/ThirdPerson/TopDown/Platformer
bool _SelectWindow = false; // Extra Tools Window
//Navigation Tool Windows
int _WindowID = 0; // Default/UpdateLog/FileFinder/ScriptToString/MapEditor
string[] _WindowNames = new string[] { "Home", "Update Log", "FileFinder", "ScriptToString", "MapEditor" };
//Scripts
Tool_QuickStart_Script[] QuickStart_Scripts = new Tool_QuickStart_Script[] {
// NAME TAGS STATE DESCRIPTION/CODE
new Tool_QuickStart_Script("AnimatorOverrider", "Animator_Overrider_Animation", "stable", "Override Animations at runtime", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class AnimatorOverrider : MonoBehaviour\n{\n [SerializeField] private AnimatorOverrideController[] _OverrideControllers;\n private Animator _Animator;\n\n private void Awake()\n {\n _Animator = GetComponent<Animator>();\n }\n\n private void Update()\n {\n //Example\n if (Input.GetKeyDown(KeyCode.Alpha1))\n Set(0);\n if (Input.GetKeyDown(KeyCode.Alpha2))\n Set(1);\n if (Input.GetKeyDown(KeyCode.Alpha3))\n Set(2);\n }\n\n public void SetAnimations(AnimatorOverrideController overridecontroller)\n {\n _Animator.runtimeAnimatorController = overridecontroller;\n }\n\n public void Set(int value)\n {\n SetAnimations(_OverrideControllers[value]);\n }\n}\n"),
new Tool_QuickStart_Script("AudioHandler", "Audio_Handler", "stable", "Play an audiotrack from any script as long as this script exists in the scene\n\nCompatible Scripts:\nAudioZone.cs", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.SceneManagement;\nusing UnityEngine;\nusing UnityEngine.Audio;\n\npublic class AudioHandler : MonoBehaviour\n{\n [Header(\"Settings\")]\n [Tooltip(\"Only used for testing disable it for the final build to improve performance\")]\n [SerializeField] private bool _RefreshSettingsOnUpdate = false;\n\n [Header(\"AudioMixer/Audio\")]\n [SerializeField] private AudioMixerGroup _AudioMixer = null;\n\n [Header(\"Audio Categorys\")]\n public List<AudioHandler_Category> Category = new List<AudioHandler_Category>();\n\n private string _CurrentScene;\n\n //You can call AudioHandler.AUDIO from every script as long as you have the script in the scene.\n public static AudioHandler AUDIO;\n\n void Awake()\n {\n AUDIO = this;\n\n //PlayOnStart\n\n for (int cat = 0; cat < Category.Count; cat++)\n {\n for (int i = 0; i < Category[cat].Sounds.Count; i++)\n {\n //AudioSource\n if (Category[cat].Sounds[i].Settings.CreateAudioSource)\n {\n //3D Space\n if (Category[cat].Sounds[i].Audio3D.Enable3DAudio)\n {\n //Create new object\n GameObject audiopos = new GameObject(\"Audio_\" + Category[cat].Sounds[i].AudioTrackName);\n\n //Set audiopos position\n if (Category[cat].Sounds[i].Audio3D.SpatialTransform != null)\n audiopos.transform.position = Category[cat].Sounds[i].Audio3D.SpatialTransform.position;\n else\n audiopos.transform.position = Category[cat].Sounds[i].Audio3D.SpatialPosition;\n audiopos.transform.parent = this.gameObject.transform;\n\n //Add AudioSource to audioposition\n Category[cat].Sounds[i].Settings.AudioSource = audiopos.AddComponent<AudioSource>();\n }\n else\n Category[cat].Sounds[i].Settings.AudioSource = this.gameObject.AddComponent<AudioSource>();\n\n //SetVolume\n Category[cat].Sounds[i].Settings.AudioSource.volume = Category[cat].Sounds[i].AudioSettings.Volume;\n\n //AudioMixer\n Category[cat].Sounds[i].Settings.AudioSource.outputAudioMixerGroup = _AudioMixer;\n\n //AudioGroup\n if (Category[cat].Sounds[i].Settings.AudioGroup != null)\n Category[cat].Sounds[i].Settings.AudioSource.outputAudioMixerGroup = Category[cat].Sounds[i].Settings.AudioGroup;\n }\n\n //3D Space Settings\n if (Category[cat].Sounds[i].Audio3D.Enable3DAudio)\n {\n Category[cat].Sounds[i].Settings.AudioSource.spatialBlend = 1;\n }\n\n //AudioClip\n if (Category[cat].Sounds[i].Settings.CreateAudioSource)\n Category[cat].Sounds[i].Settings.AudioSource.clip = Category[cat].Sounds[i].Settings.AudioClip;\n\n //Settings\n if (!Category[cat].Sounds[i].AudioSettings.PlayOnStart_DiplicateOnly)\n {\n if (Category[cat].Sounds[i].AudioSettings.PlayOnStart)\n {\n Category[cat].Sounds[i].Settings.AudioSource.playOnAwake = Category[cat].Sounds[i].AudioSettings.PlayOnStart;\n Category[cat].Sounds[i].Settings.AudioSource.Play();\n }\n if (Category[cat].Sounds[i].AudioEffects.FadeIn)\n {\n Category[cat].Sounds[i].Settings.AudioSource.volume = 1;\n Category[cat].Sounds[i].AudioEffects.FadeInSpeed = Category[cat].Sounds[i].AudioSettings.Volume / Category[cat].Sounds[i].AudioEffects.FadeInDuration;\n }\n if (Category[cat].Sounds[i].AudioEffects.FadeOut)\n {\n Category[cat].Sounds[i].AudioEffects.FadeOutSpeed = Category[cat].Sounds[i].AudioSettings.Volume / Category[cat].Sounds[i].AudioEffects.FadeOutDuration;\n }\n }\n }\n }\n\n\n RefreshSettings_AllCategories();\n }\n\n void Update()\n {\n CheckNewScene();\n\n if (_RefreshSettingsOnUpdate)\n RefreshSettings_AllCategories();\n\n for (int cat = 0; cat < Category.Count; cat++)\n {\n if (!Category[cat]._CallOnly)\n {\n for (int i = 0; i < Category[cat].Sounds.Count; i++)\n {\n //FadeIn\n if (Category[cat].Sounds[i].AudioEffects.FadingIn)\n {\n if (Category[cat].Sounds[i].AudioEffects.FadeIn && !Category[cat].Sounds[i].AudioEffects.FadeInDone)\n {\n if (Category[cat].Sounds[i].Settings.AudioSource.volume < Category[cat].Sounds[i].AudioSettings.Volume)\n {\n Category[cat].Sounds[i].Settings.AudioSource.volume += Category[cat].Sounds[i].AudioEffects.FadeInSpeed * Time.deltaTime;\n }\n else\n {\n Category[cat].Sounds[i].AudioEffects.FadeInDone = true;\n Category[cat].Sounds[i].Settings.AudioSource.volume = Category[cat].Sounds[i].AudioSettings.Volume;\n }\n }\n }\n //FadeOut\n if (Category[cat].Sounds[i].AudioEffects.FadingOut)\n {\n if (Category[cat].Sounds[i].AudioEffects.FadeOutAfterTime > -0.1f)\n {\n Category[cat].Sounds[i].AudioEffects.FadeOutAfterTime -= 1 * Time.deltaTime;\n }\n else\n {\n if (Category[cat].Sounds[i].AudioEffects.FadeOut && !Category[cat].Sounds[i].AudioEffects.FadeOutDone)\n {\n if (Category[cat].Sounds[i].Settings.AudioSource.volume > 0)\n {\n Category[cat].Sounds[i].Settings.AudioSource.volume -= Category[cat].Sounds[i].AudioEffects.FadeOutSpeed * Time.deltaTime;\n }\n else\n {\n Category[cat].Sounds[i].AudioEffects.FadeOutDone = true;\n Category[cat].Sounds[i].Settings.AudioSource.volume = 0;\n Category[cat].Sounds[i].Settings.AudioSource.Stop();\n }\n }\n }\n }\n }\n }\n }\n }\n\n private void CheckNewScene()\n {\n if (_CurrentScene != SceneManager.GetActiveScene().name)\n {\n _CurrentScene = SceneManager.GetActiveScene().name;\n for (int cat = 0; cat < Category.Count; cat++)\n {\n if (!Category[cat]._CallOnly)\n {\n for (int i = 0; i < Category[cat].Sounds.Count; i++)\n {\n //Stop NextScene\n if (Category[cat].Sounds[i].AudioControl.StopOnNextScene)\n {\n //FadeOut\n if (Category[cat].Sounds[i].AudioEffects.FadeOut && !Category[cat].Sounds[i].AudioEffects.FadingOut)\n {\n Category[cat].Sounds[i].AudioEffects.FadingIn = false;\n Category[cat].Sounds[i].AudioEffects.FadeOutDone = false;\n Category[cat].Sounds[i].AudioEffects.FadingOut = true;\n }\n else\n Category[cat].Sounds[i].Settings.AudioSource.Stop();\n }\n\n //Start AudioOnScene\n for (int o = 0; o < Category[cat].Sounds[i].AudioControl.StartAudioOnScene.Count; o++)\n {\n if (Category[cat].Sounds[i].AudioControl.StartAudioOnScene[o] == _CurrentScene)\n {\n //FadeIn\n if (Category[cat].Sounds[i].AudioEffects.FadeIn)\n {\n Category[cat].Sounds[i].AudioEffects.FadingOut = false;\n Category[cat].Sounds[i].AudioEffects.FadeInDone = false;\n Category[cat].Sounds[i].AudioEffects.FadingIn = true;\n }\n Category[cat].Sounds[i].Settings.AudioSource.Play();\n }\n }\n\n //Stop AudioOnScene\n for (int o = 0; o < Category[cat].Sounds[i].AudioControl.StopAudioOnScene.Count; o++)\n {\n if (Category[cat].Sounds[i].AudioControl.StopAudioOnScene[o] == _CurrentScene)\n {\n //FadeOut\n if (Category[cat].Sounds[i].AudioEffects.FadeOut && !Category[cat].Sounds[i].AudioEffects.FadingOut)\n {\n Category[cat].Sounds[i].AudioEffects.FadingIn = false;\n Category[cat].Sounds[i].AudioEffects.FadeOutDone = false;\n Category[cat].Sounds[i].AudioEffects.FadingOut = true;\n }\n else\n Category[cat].Sounds[i].Settings.AudioSource.Stop();\n }\n }\n }\n }\n }\n }\n }\n //Always returns positive number to prevent errors\n private int AudioHandler_GetTrackID_Safe(string trackname, int categoryid)\n {\n for (int i = 0; i < Category[categoryid].Sounds.Count; i++)\n if (Category[categoryid].Sounds[i].AudioTrackName == trackname)\n return i;\n Debug.Log($\"<color=#FF0000>AudioTrack:</color> {trackname} is not found in category: {Category[categoryid].CategoryName}, returned 0\");\n return 0;\n }\n //Return negative when audiotrack is not found (used for functions that check if trackname exists)\n private int AudioHandler_GetTrackID_Unsafe(string trackname, int categoryid)\n {\n for (int i = 0; i < Category[categoryid].Sounds.Count; i++)\n if (Category[categoryid].Sounds[i].AudioTrackName == trackname)\n return i;\n Debug.Log($\"<color=#215EFF>AudioTrack:</color> {trackname} is not found in category: {Category[categoryid].CategoryName},{categoryid}, returned 0\");\n return 0;\n }\n private void AudioHandler_PlayTrack(int trackid, int categoryid = 0)\n {\n Category[categoryid].Sounds[trackid].Settings.AudioSource.Play();\n }\n\n /// <summary>Plays the audiotrack.</summary>\n public void PlayTrack(int trackid, int categoryid = 0)\n {\n AudioHandler_PlayTrack(trackid, categoryid);\n }\n public void PlayTrack(string trackname, int categoryid = 0)\n {\n AudioHandler_PlayTrack(AudioHandler_GetTrackID_Safe(trackname, categoryid), categoryid);\n }\n\n //For EventSystem\n public void PlayTrack_ForEventSystem(string trackname)\n {\n AudioHandler_PlayTrack(AudioHandler_GetTrackID_Safe(trackname, 0), 0);\n }\n public void StopTrack_ForEventSystem(string trackname)\n {\n Category[0].Sounds[AudioHandler_GetTrackID_Safe(trackname, 0)].Settings.AudioSource.Stop();\n }\n\n /// <summary>Plays the audiotrack if it's not playing yet.</summary>\n public void StartTrack(string trackname, int categoryid = 0)\n {\n int trackid = AudioHandler_GetTrackID_Safe(trackname, categoryid);\n if (!Category[categoryid].Sounds[trackid].Settings.AudioSource.isPlaying)\n AudioHandler_PlayTrack(trackid, categoryid);\n }\n public void StartTrack(int trackid, int categoryid = 0)\n {\n if (!Category[categoryid].Sounds[trackid].Settings.AudioSource.isPlaying)\n AudioHandler_PlayTrack(trackid, categoryid);\n }\n\n /// <summary>Stops the audiotrack.</summary>\n public void StopTrack(string trackname, int categoryid = 0)\n {\n Category[categoryid].Sounds[AudioHandler_GetTrackID_Safe(trackname, categoryid)].Settings.AudioSource.Stop();\n }\n public void StopTrack(int trackid, int categoryid = 0)\n {\n Category[categoryid].Sounds[trackid].Settings.AudioSource.Stop();\n }\n\n /// <summary>Returns audio file name.</summary>\n public string Get_Track_AudioFileName(string trackname, int categoryid = 0)\n {\n int trackid = AudioHandler_GetTrackID_Unsafe(trackname, categoryid);\n if (trackid >= 0)\n return Category[categoryid].Sounds[trackid].Settings.AudioClip.name;\n else\n return \"No AudioClip detected\";\n }\n public string Get_Track_AudioFileName(int trackid, int categoryid = 0)\n {\n return Category[categoryid].Sounds[trackid].Settings.AudioClip.name;\n }\n\n /// <summary>Returns audio source.</summary>\n public AudioSource Get_AudioSource(string trackname, int categoryid = 0)\n {\n int trackid = AudioHandler_GetTrackID_Unsafe(trackname, categoryid);\n if (trackid >= 0)\n return Category[categoryid].Sounds[trackid].Settings.AudioSource;\n else\n return null;\n }\n public AudioSource Get_AudioSource(int trackid, int categoryid = 0)\n {\n return Category[categoryid].Sounds[trackid].Settings.AudioSource;\n }\n\n /// <summary>Set audiosource.</summary>\n public void SetAudioSource(string trackname, AudioSource audiosource, int categoryid = 0)\n {\n Category[categoryid].Sounds[AudioHandler_GetTrackID_Safe(trackname, categoryid)].Settings.AudioSource = audiosource;\n }\n public void SetAudioSource(int trackid, AudioSource audiosource, int categoryid = 0)\n {\n Category[categoryid].Sounds[trackid].Settings.AudioSource = audiosource;\n }\n\n /// <summary>Set track volume.</summary>\n public void SetTrackVolume(string trackname, float volume, bool checkmaxvolume, int categoryid = 0)\n {\n int trackid = AudioHandler_GetTrackID_Safe(trackname, categoryid);\n if (!checkmaxvolume)\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = volume;\n else\n if (volume >= Category[categoryid].Sounds[trackid].AudioSettings.MaxVolume)\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = Category[categoryid].Sounds[trackid].AudioSettings.MaxVolume;\n else\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = volume;\n }\n public void SetTrackVolume(int trackid, float volume, bool checkmaxvolume, int categoryid = 0)\n {\n if (!checkmaxvolume)\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = volume;\n else if (volume >= Category[categoryid].Sounds[trackid].AudioSettings.MaxVolume)\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = Category[categoryid].Sounds[trackid].AudioSettings.MaxVolume;\n else\n Category[categoryid].Sounds[trackid].AudioSettings.Volume = volume;\n }\n\n /// <summary>Returns track id.</summary>\n public int Get_Track_ID(string trackname, int categoryid = 0)\n {\n return AudioHandler_GetTrackID_Unsafe(trackname, categoryid);\n }\n\n /// <summary>Refresh settings.</summary>\n public void RefreshSettings_AllCategories()\n {\n for (int i = 0; i < Category.Count; i++)\n {\n for (int j = 0; j < Category[i].Sounds.Count; j++)\n {\n if (Category[i].Sounds[j].Settings.CreateAudioSource)\n {\n if (Category[i].Sounds[j].Settings.AudioSource.clip != Category[i].Sounds[j].Settings.AudioClip)\n Category[i].Sounds[j].Settings.AudioSource.clip = Category[i].Sounds[j].Settings.AudioClip;\n //SetEffects\n if (!Category[i].Sounds[j].AudioEffects.FadeIn || Category[i].Sounds[j].AudioEffects.FadeIn && Category[i].Sounds[j].AudioEffects.FadeInDone)\n Category[i].Sounds[j].Settings.AudioSource.volume = Category[i].Sounds[j].AudioSettings.Volume;\n Category[i].Sounds[j].Settings.AudioSource.loop = Category[i].Sounds[j].AudioSettings.Loop;\n }\n }\n }\n }\n\n /// <summary>Duplicate AudioTrack.</summary>\n public string DuplicateAudioTrack(string trackname, int categoryid = 0)\n {\n int audioid = Get_Track_ID(trackname, categoryid);\n if (audioid == -1)\n return null;\n\n AudioHandler_Sound newsound = new AudioHandler_Sound();\n GameObject newaudiopos = new GameObject();\n\n newsound.AudioTrackName = \"Audio_\" + Category[categoryid].Sounds[audioid].AudioTrackName;\n\n //Settings\n newsound.Settings = new AudioHandler_Settings();\n newsound.Settings.AudioClip = Category[categoryid].Sounds[audioid].Settings.AudioClip;\n newsound.Settings.AudioGroup = Category[categoryid].Sounds[audioid].Settings.AudioGroup;\n newsound.Settings.AudioSource = newaudiopos.AddComponent<AudioSource>();\n newsound.Settings.CreateAudioSource = Category[categoryid].Sounds[audioid].Settings.CreateAudioSource;\n\n //Control\n newsound.AudioControl = new AudioHandler_Control();\n newsound.AudioControl.SceneEnabled = Category[categoryid].Sounds[audioid].AudioControl.SceneEnabled;\n newsound.AudioControl.StartAudioOnScene = Category[categoryid].Sounds[audioid].AudioControl.StartAudioOnScene;\n newsound.AudioControl.StopAudioOnScene = Category[categoryid].Sounds[audioid].AudioControl.StopAudioOnScene;\n newsound.AudioControl.StopOnNextScene = Category[categoryid].Sounds[audioid].AudioControl.StopOnNextScene;\n\n //Audio3D\n newsound.Audio3D = new AudioHandler_3DAudio();\n newsound.Audio3D.Enable3DAudio = Category[categoryid].Sounds[audioid].Audio3D.Enable3DAudio;\n newsound.Audio3D.SpatialPosition = Category[categoryid].Sounds[audioid].Audio3D.SpatialPosition;\n newsound.Audio3D.SpatialTransform = Category[categoryid].Sounds[audioid].Audio3D.SpatialTransform;\n\n //AudioSettings\n newsound.AudioSettings = new AudioHandler_AudioSettings();\n newsound.AudioSettings.Loop = Category[categoryid].Sounds[audioid].AudioSettings.Loop;\n newsound.AudioSettings.MaxVolume = Category[categoryid].Sounds[audioid].AudioSettings.MaxVolume;\n newsound.AudioSettings.PlayOnStart = Category[categoryid].Sounds[audioid].AudioSettings.PlayOnStart;\n newsound.AudioSettings.Volume = Category[categoryid].Sounds[audioid].AudioSettings.Volume;\n\n //AudioEffect\n newsound.AudioEffects = new AudioHandler_Effects();\n newsound.AudioEffects.FadeIn = Category[categoryid].Sounds[audioid].AudioEffects.FadeIn;\n newsound.AudioEffects.FadeInDone = Category[categoryid].Sounds[audioid].AudioEffects.FadeInDone;\n newsound.AudioEffects.FadeInDuration = Category[categoryid].Sounds[audioid].AudioEffects.FadeInDuration;\n newsound.AudioEffects.FadeInSpeed = Category[categoryid].Sounds[audioid].AudioEffects.FadeInSpeed;\n newsound.AudioEffects.FadeOut = Category[categoryid].Sounds[audioid].AudioEffects.FadeOut;\n newsound.AudioEffects.FadeOutAfterTime = Category[categoryid].Sounds[audioid].AudioEffects.FadeOutAfterTime;\n newsound.AudioEffects.FadeOutDone = Category[categoryid].Sounds[audioid].AudioEffects.FadeOutDone;\n newsound.AudioEffects.FadeOutDuration = Category[categoryid].Sounds[audioid].AudioEffects.FadeOutDuration;\n newsound.AudioEffects.FadeOutSpeed = Category[categoryid].Sounds[audioid].AudioEffects.FadeOutSpeed;\n newsound.AudioEffects.FadingIn = Category[categoryid].Sounds[audioid].AudioEffects.FadingIn;\n newsound.AudioEffects.FadingOut = Category[categoryid].Sounds[audioid].AudioEffects.FadingOut;\n\n newsound.AudioTrackName += \"_\" + Category[categoryid].Sounds.Count.ToString();\n\n //Activate Settings\n newsound.Settings.AudioSource.loop = newsound.AudioSettings.Loop;\n newsound.Settings.AudioSource.volume = newsound.AudioSettings.Volume;\n if (newsound.Audio3D.Enable3DAudio)\n newsound.Settings.AudioSource.spatialBlend = 1;\n if (newsound.AudioSettings.PlayOnStart)\n newsound.Settings.AudioSource.Play();\n\n //Create new object\n newaudiopos.transform.name = newsound.AudioTrackName;\n\n //Audio Source Settings\n newsound.Settings.AudioSource.clip = newsound.Settings.AudioClip;\n newsound.Settings.AudioSource.outputAudioMixerGroup = newsound.Settings.AudioGroup;\n\n //Apply\n newaudiopos.transform.parent = this.transform;\n Category[categoryid].Sounds.Add(newsound);\n\n //Position\n if (newsound.Audio3D.SpatialTransform != null)\n ChangeAudioPosition(newsound.AudioTrackName, newsound.Audio3D.SpatialTransform.position, categoryid);\n else\n ChangeAudioPosition(newsound.AudioTrackName, newsound.Audio3D.SpatialPosition, categoryid);\n\n //PlayOnStart\n newsound.AudioSettings.PlayOnStart_DiplicateOnly = Category[categoryid].Sounds[audioid].AudioSettings.PlayOnStart_DiplicateOnly;\n if (newsound.AudioSettings.PlayOnStart_DiplicateOnly)\n {\n newsound.Settings.AudioSource.playOnAwake = true;\n newsound.Settings.AudioSource.Play();\n }\n return newsound.AudioTrackName;\n }\n\n /// <summary>Change AudioSource Position.</summary>\n public void ChangeAudioPosition(string trackname, Vector3 newpos, int categoryid = 0)\n {\n int audioid = Get_Track_ID(trackname, categoryid);\n if (audioid != -1)\n Category[categoryid].Sounds[audioid].Settings.AudioSource.transform.position = newpos;\n }\n public void ChangeAudioPosition(int trackid, Vector3 newpos, int categoryid = 0)\n {\n Category[categoryid].Sounds[trackid].Settings.AudioSource.transform.position = newpos;\n }\n\n /// <summary>Set AudioSource Parent.</summary>\n public void ChangeAudioParent(string trackname, Transform newparent, int categoryid = 0)\n {\n int audioid = Get_Track_ID(trackname, categoryid);\n if (audioid != -1)\n Category[categoryid].Sounds[audioid].Settings.AudioSource.transform.parent = newparent;\n }\n public void ChangeAudioParent(int trackid, Transform newparent, int categoryid = 0)\n {\n Category[categoryid].Sounds[trackid].Settings.AudioSource.transform.parent = newparent;\n }\n\n /// <summary>Returns clip names\n public string GetTracksActive()\n {\n string searchtracksactive = \"\";\n for (int cat = 0; cat < Category.Count; cat++)\n {\n for (int i = 0; i < Category[cat].Sounds.Count; i++)\n {\n if (Category[cat].Sounds[i].Settings.CreateAudioSource)\n if (Category[cat].Sounds[i].Settings.AudioSource.isPlaying)\n searchtracksactive += Category[cat].Sounds[i].Settings.AudioClip.name + \"\n\";\n }\n }\n return searchtracksactive;\n }\n public int GetTracksActiveAmount()\n {\n int searchtracksactive = 0;\n for (int cat = 0; cat < Category.Count; cat++)\n {\n for (int i = 0; i < Category[cat].Sounds.Count; i++)\n {\n if (Category[cat].Sounds[i].Settings.CreateAudioSource)\n if (Category[cat].Sounds[i].Settings.AudioSource.isPlaying)\n searchtracksactive++;\n }\n }\n return searchtracksactive;\n }\n}\n\n[System.Serializable]\npublic class AudioHandler_Category\n{\n public string CategoryName;\n public List<AudioHandler_Sound> Sounds;\n\n [Header(\"Performance\")]\n public bool _CallOnly;\n}\n\n[System.Serializable]\npublic class AudioHandler_Sound\n{\n public string AudioTrackName;\n public AudioHandler_Settings Settings;\n public AudioHandler_AudioSettings AudioSettings;\n public AudioHandler_3DAudio Audio3D;\n public AudioHandler_Control AudioControl;\n public AudioHandler_Effects AudioEffects;\n}\n\n[System.Serializable]\npublic class AudioHandler_Settings\n{\n [Header(\"AudioClip/AudioMixerGroup\")]\n public AudioClip AudioClip;\n public AudioMixerGroup AudioGroup;\n\n [Header(\"AudioSource\")]\n public AudioSource AudioSource;\n public bool CreateAudioSource;\n}\n\n[System.Serializable]\npublic class AudioHandler_AudioSettings\n{\n [Header(\"AudioSettings\")]\n [Range(0, 1)] public float Volume = 1;\n [Range(0, 1)] public float MaxVolume = 1;\n public bool Loop;\n public bool PlayOnStart;\n public bool PlayOnStart_DiplicateOnly;\n}\n\n[System.Serializable]\npublic class AudioHandler_Control\n{\n [Header(\"Enable/Disable Song\")]\n public List<string> StartAudioOnScene = new List<string>();\n public List<string> StopAudioOnScene = new List<string>();\n public bool StopOnNextScene;\n [HideInInspector] public int SceneEnabled;\n}\n\n[System.Serializable]\npublic class AudioHandler_Effects\n{\n [Header(\"FadeIn\")]\n public bool FadeIn;\n public float FadeInDuration;\n [HideInInspector] public float FadeInSpeed;\n [HideInInspector] public bool FadeInDone;\n [HideInInspector] public bool FadingIn;\n [Header(\"FadeOut\")]\n public bool FadeOut;\n public float FadeOutAfterTime;\n public float FadeOutDuration;\n [HideInInspector] public float FadeOutSpeed;\n [HideInInspector] public bool FadeOutDone;\n [HideInInspector] public bool FadingOut;\n}\n\n[System.Serializable]\npublic class AudioHandler_3DAudio\n{\n [Header(\"3D Space / (0,0,0)+null = this object position\")]\n public bool Enable3DAudio;\n public Vector3 SpatialPosition;\n public Transform SpatialTransform;\n}\n"),
new Tool_QuickStart_Script("AudioZone", "Audio_Zone_Handler", "stable", "!This script needs AudioHandler.cs to work!\n\nUse AudioZone.cs to place/play audio in 3d space\n\nCompatible Scripts:\nAudioZoneEditor.cs", "using UnityEngine;\n\npublic class AudioZone : MonoBehaviour\n{\n private enum Options { SetVolume, VolumeOnDistance };\n [Header(\"Type\")]\n [SerializeField] private Options _Option = Options.SetVolume;\n\n [Header(\"Target\")]\n [SerializeField] private Transform _ZoneEffector = null;\n\n [Header(\"Settings - Zone\")]\n [SerializeField] private string _AudioTrackName = \"\";\n [SerializeField] private int _Categoryid = 0;\n [SerializeField] private float _Volume = 1;\n public float Range = 10;\n [Tooltip(\"1 = volume from 0 to max based on how close the effector is to the center.\")]\n [SerializeField] private float _IncreaseMultiplier = 1;\n\n [Header(\"3D Audio\")]\n [SerializeField] private bool _Use3DAudio = true;\n [SerializeField] private bool _UseThisPos = true;\n [SerializeField] private bool _SetParentToThis = true;\n [SerializeField] private bool _UpdateToThisPos = false;\n [SerializeField] private bool _CreateNewAudioSource = true;\n\n [SerializeField] private AudioSource _AudioSource;\n\n [Header(\"CustomCurve\")]\n [SerializeField] private bool _SetCustomCurve;\n [SerializeField] private AnimationCurve _CustomCurve;\n\n // Check effector leaving bounds\n private bool _EffectorInBounds;\n\n // Optimization (This way the AudioHandler doesn't have to loop trough the available audiotracks)\n private int _AudioTrackID;\n\n // Max distance\n private float _MaxDistance;\n\n void Start()\n {\n if (AudioHandler.AUDIO != null)\n {\n //3D Audio\n if (_Use3DAudio)\n {\n if (_CreateNewAudioSource)\n _AudioTrackName = AudioHandler.AUDIO.DuplicateAudioTrack(_AudioTrackName, _Categoryid);\n\n if (_UseThisPos)\n AudioHandler.AUDIO.ChangeAudioPosition(_AudioTrackName, transform.position, _Categoryid);\n if (_SetParentToThis)\n AudioHandler.AUDIO.ChangeAudioParent(_AudioTrackName, this.transform, _Categoryid);\n }\n\n if (_ZoneEffector == null)\n {\n try\n {\n _ZoneEffector = GameObject.FindObjectsOfType<AudioListener>()[0].gameObject.transform;\n }\n catch { Debug.Log(\"No AudioListener Found In The Scene\"); }\n }\n\n // Get TrackID\n _AudioTrackID = AudioHandler.AUDIO.Get_Track_ID(_AudioTrackName, _Categoryid);\n if (_AudioTrackID == -1)\n Debug.Log(\"AudioZone: Track(\" + _AudioTrackName + \") Does not Exist\");\n\n // Set max distance\n _MaxDistance = Range;\n _AudioSource = AudioHandler.AUDIO.Get_AudioSource(_AudioTrackID, _Categoryid);\n _AudioSource.maxDistance = Range;\n _AudioSource.rolloffMode = AudioRolloffMode.Custom;\n if (_SetCustomCurve)\n _AudioSource.SetCustomCurve(AudioSourceCurveType.CustomRolloff, _CustomCurve);\n else\n _AudioSource.rolloffMode = AudioRolloffMode.Linear;\n _AudioSource.volume = _Volume;\n }\n else\n {\n _AudioTrackID = -1;\n Debug.Log(\"AudioZone: AudioHandler does not exist in this scene\");\n }\n }\n\n void Update()\n {\n if (_AudioTrackID == -1)\n return;\n if (Vector3.Distance(transform.position, _ZoneEffector.position) <= _MaxDistance)\n {\n switch (_Option)\n {\n case Options.SetVolume:\n AudioHandler.AUDIO.SetTrackVolume(_AudioTrackID, _Volume, true, _Categoryid);\n break;\n case Options.VolumeOnDistance:\n float distance = Vector3.Distance(transform.position, _ZoneEffector.position);\n float newvolume = (1 - (distance / _MaxDistance)) * _Volume * _IncreaseMultiplier;\n AudioHandler.AUDIO.SetTrackVolume(_AudioTrackID, newvolume, true, _Categoryid);\n break;\n }\n\n // Check Effector OnExit\n if (!_EffectorInBounds)\n _EffectorInBounds = true;\n }\n else\n {\n // Effector OnExit\n if (_EffectorInBounds)\n {\n AudioHandler.AUDIO.SetTrackVolume(_AudioTrackID, 0, true, _Categoryid);\n _EffectorInBounds = false;\n }\n }\n\n if (_UpdateToThisPos)\n AudioHandler.AUDIO.ChangeAudioPosition(_AudioTrackID, transform.position, _Categoryid);\n }\n\n public void PlayTrack()\n {\n AudioHandler.AUDIO.PlayTrack(_AudioTrackName, _Categoryid);\n }\n public void StartTrack()\n {\n AudioHandler.AUDIO.StartTrack(_AudioTrackName, _Categoryid);\n }\n public void StopTrack()\n {\n AudioHandler.AUDIO.StopTrack(_AudioTrackName, _Categoryid);\n }\n\n public string GetTrackName()\n {\n return _AudioTrackName;\n }\n\n public void Set_Volume(float newvolume)\n {\n _Volume = newvolume;\n _AudioSource.volume = newvolume;\n }\n\n private void OnDrawGizmosSelected()\n {\n Gizmos.color = new Vector4(0, 1f, 0, 0.1f);\n Gizmos.DrawSphere(transform.position, Range);\n }\n}\n"),
new Tool_QuickStart_Script("AudioZoneEditor", "Audio_Zone_Handler_Editor", "stable", "!Editor script for AudioZone.cs!\n\nEdit the audiozone's easily in the editorscene", "using UnityEditor;\nusing UnityEditor.IMGUI.Controls;\nusing UnityEngine;\n\n[CustomEditor(typeof(AudioZone)), CanEditMultipleObjects]\npublic class AudioZoneEditor : Editor\n{\n private SphereBoundsHandle _BoundsHandle = new SphereBoundsHandle();\n\n protected virtual void OnSceneGUI()\n {\n AudioZone audiozone = (AudioZone)target;\n\n _BoundsHandle.center = audiozone.transform.position;\n _BoundsHandle.radius = audiozone.Range;\n\n EditorGUI.BeginChangeCheck();\n _BoundsHandle.DrawHandle();\n if (EditorGUI.EndChangeCheck())\n {\n Undo.RecordObject(audiozone, \"Change Bounds\");\n\n BoundingSphere newBounds = new BoundingSphere();\n newBounds.position = audiozone.transform.position;\n newBounds.radius = _BoundsHandle.radius;\n\n audiozone.Range = _BoundsHandle.radius;\n }\n\n }\n}\n"),
new Tool_QuickStart_Script("BasicNavMeshAI", "AI_NavMesh", "stable", "Follows Target With NavMesh", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.AI;\n\npublic class BasicNavMeshAI : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private Transform _Target = null;\n [SerializeField] private float _Speed = 2;\n\n private NavMeshAgent _Agent;\n\n private void Awake()\n {\n if (_Target == null)\n {\n try\n {\n _Target = GameObject.Find(\"Player\").transform;\n }\n catch\n {\n Debug.Log(\"No Target\");\n }\n }\n\n _Agent = GetComponent<NavMeshAgent>();\n _Agent.speed = _Speed;\n }\n\n private void Update()\n {\n if (_Target != null)\n {\n _Agent.SetDestination(_Target.position);\n }\n }\n}\n"),
new Tool_QuickStart_Script("Bullet", "Shooting_Bullet", "stable", "Move Bullet Forward + Collision", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Bullet : MonoBehaviour\n{\n [SerializeField] private float _Speed = 5;\n [SerializeField] private float _Damage = 25;\n\n void FixedUpdate()\n {\n transform.Translate(Vector3.forward * _Speed * Time.deltaTime);\n }\n\n private void OnTriggerEnter(Collider other)\n {\n if(other.tag == \"Enemy\")\n {\n other.GetComponent<Health>().DoDamage(_Damage);\n gameObject.SetActive(false);\n }\n if(other.tag == \"Wall\")\n {\n gameObject.SetActive(false);\n }\n }\n}\n"),
new Tool_QuickStart_Script("CarArcade", "Car_Drive_Vehicle", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class CarArcade : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _ForwardAccel = 8;\n [SerializeField] private float _ReverseAccel = 4;\n [SerializeField] private float _TurnStrength = 180;\n [SerializeField] private float _GravityForce = 15;\n\n [Header(\"GroundCheck\")]\n [SerializeField] private LayerMask _GroundMask = ~0;\n [SerializeField] private float _GroundCheckLength = 0.5f;\n\n [Header(\"RigidBody\")]\n [SerializeField] private Rigidbody _RB = null;\n\n private float _SpeedInput;\n private float _TurnInput;\n private bool _Grounded;\n\n void Start() => _RB.transform.parent = null;\n\n void Update()\n {\n _SpeedInput = 0;\n if(Input.GetAxis(\"Vertical\") > 0)\n _SpeedInput = Input.GetAxis(\"Vertical\") * _ForwardAccel * 1000;\n else if(Input.GetAxis(\"Vertical\") < 0)\n _SpeedInput = Input.GetAxis(\"Vertical\") * _ReverseAccel * 1000;\n\n _TurnInput = Input.GetAxis(\"Horizontal\");\n\n if(_Grounded)\n transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles + new Vector3(0, _TurnInput * _TurnStrength * Time.deltaTime, 0));\n\n transform.position = _RB.transform.position;\n }\n\n private void FixedUpdate()\n {\n _Grounded = GroundCheck();\n\n if (_Grounded)\n {\n if (Mathf.Abs(_SpeedInput) > 0)\n _RB.AddForce(transform.forward * _SpeedInput);\n }\n else\n _RB.AddForce(Vector3.up * -_GravityForce * 100);\n }\n\n private bool GroundCheck()\n {\n _Grounded = false;\n RaycastHit hit;\n\n if(Physics.Raycast(transform.position, -transform.up, out hit, _GroundCheckLength, _GroundMask))\n {\n _Grounded = true;\n transform.rotation = Quaternion.FromToRotation(transform.up, hit.normal) * transform.rotation;\n }\n\n return _Grounded;\n }\n}\n"),
new Tool_QuickStart_Script("CarRealistic", "Car_Drive_Vehicle", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class CarRealistic : MonoBehaviour\n{\n [Header(\"Motor\")]\n [SerializeField] private List<AxleInfo> axleInfos = null;\n [SerializeField] private float maxMotorTorque = 1000;\n\n [Header(\"Steering\")]\n [SerializeField] private float maxSteeringAngle = 50;\n\n public void FixedUpdate()\n {\n float motor = maxMotorTorque * Input.GetAxis(\"Vertical\");\n float steering = maxSteeringAngle * Input.GetAxis(\"Horizontal\");\n\n foreach (AxleInfo axleInfo in axleInfos)\n {\n if (axleInfo.steering)\n {\n axleInfo.leftWheel.steerAngle = steering;\n axleInfo.rightWheel.steerAngle = steering;\n }\n if (axleInfo.motor)\n {\n axleInfo.leftWheel.motorTorque = motor;\n axleInfo.rightWheel.motorTorque = motor;\n }\n }\n }\n\n}\n\n[System.Serializable]\npublic class AxleInfo\n{\n public WheelCollider leftWheel;\n public WheelCollider rightWheel;\n public bool motor;\n public bool steering;\n}\n"),
new Tool_QuickStart_Script("Clock", "Clock_Practical", "stable", "Clock Digital+Analog", "using System.Collections;\nusing System.Collections.Generic;\nusing System;\nusing UnityEngine;\n\npublic class Clock : MonoBehaviour\n{\n [Header(\"0,0,0 = SystemTime / else Custom Time\")]\n public Vector3 CurrentTime_Number;\n\n [Header(\"Info Only\")]\n public float CurrentTime;\n public string CurrentTime_String24H;\n public string CurrentTime_String12H;\n\n\n public enum DirectionOptions { Right, Left, Forward, Back }\n [Header(\"Direction\")]\n public DirectionOptions ArrowDirection;\n\n private bool _CustomTime;\n private Vector3 _Direction;\n private Vector3 _CurrentTime_NumberSmooth;\n\n [Header(\"Clock\")]\n [SerializeField] private List<Clock_Arrow> Arrows = new List<Clock_Arrow>();\n\n private void Start()\n {\n if (CurrentTime == 0 && CurrentTime_Number == Vector3.zero)\n _CustomTime = false;\n else\n {\n _CustomTime = true;\n if (CurrentTime_Number != Vector3.zero)\n CurrentTime = CurrentTime_Number.z + (CurrentTime_Number.y * 60) + (CurrentTime_Number.x * 3600);\n }\n\n switch (ArrowDirection)\n {\n case DirectionOptions.Right:\n _Direction = Vector3.right;\n break;\n case DirectionOptions.Left:\n _Direction = Vector3.left;\n break;\n case DirectionOptions.Forward:\n _Direction = Vector3.forward;\n break;\n case DirectionOptions.Back:\n _Direction = Vector3.back;\n break;\n }\n }\n\n void Update()\n {\n if (!_CustomTime)\n CurrentTime = DateTime.Now.Second + (DateTime.Now.Minute * 60) + (DateTime.Now.Hour * 3600) + (DateTime.Now.Millisecond * 0.001f);\n else\n CurrentTime += 1 * Time.deltaTime;\n CurrentTime_Number = new Vector3(Mathf.Floor(CurrentTime / 3600), Mathf.Floor((CurrentTime / 60) % 60), Mathf.Floor(CurrentTime % 60));\n _CurrentTime_NumberSmooth = new Vector3(CurrentTime / 3600, (CurrentTime / 60) % 60, CurrentTime % 60);\n CurrentTime_String24H = string.Format(\"{0:00}:{1:00}:{2:00}\", Mathf.Floor(CurrentTime / 3600), Mathf.Floor((CurrentTime / 60) % 60), CurrentTime % 60);\n\n CurrentTime_String12H = \"\";\n if (CurrentTime > 43200)\n CurrentTime_String12H = string.Format(\"{0:00}:{1:00} PM\", Mathf.Floor(CurrentTime / 3600) - 12, Mathf.Floor((CurrentTime / 60) % 60));\n else\n CurrentTime_String12H = string.Format(\"{0:00}:{1:00} AM\", Mathf.Floor(CurrentTime / 3600), Mathf.Floor((CurrentTime / 60) % 60));\n\n for (int i = 0; i < Arrows.Count; i++)\n {\n switch (Arrows[i].Type)\n {\n case Clock_Arrow.ArrowType.Hour:\n if (Arrows[i].Smooth)\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 12) * _CurrentTime_NumberSmooth.x, _Direction);\n else\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 12) * CurrentTime_Number.x, _Direction);\n break;\n case Clock_Arrow.ArrowType.Minute:\n if (Arrows[i].Smooth)\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 60) * _CurrentTime_NumberSmooth.y, _Direction);\n else\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 60) * CurrentTime_Number.y, _Direction);\n break;\n case Clock_Arrow.ArrowType.Second:\n if (Arrows[i].Smooth)\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 60) * _CurrentTime_NumberSmooth.z, _Direction);\n else\n Arrows[i].ArrowObj.rotation = Quaternion.AngleAxis((360 / 60) * CurrentTime_Number.z, _Direction);\n break;\n }\n }\n }\n}\n\n[System.Serializable]\npublic class Clock_Arrow\n{\n public enum ArrowType { Hour, Minute, Second }\n public ArrowType Type;\n public Transform ArrowObj;\n public bool Smooth;\n}\n"),
new Tool_QuickStart_Script("CursorState", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class CursorState : MonoBehaviour\n{\n\n public enum CursorStates {Free_Show,Free_NotShow, Locked_Show, Locked_NotShow }\n [SerializeField] private CursorStates _CursorState;\n\n void Start()\n {\n switch(_CursorState)\n {\n case CursorStates.Free_Show:\n Cursor.lockState = CursorLockMode.None;\n Cursor.visible = true;\n break;\n case CursorStates.Free_NotShow:\n Cursor.lockState = CursorLockMode.None;\n Cursor.visible = false;\n break;\n case CursorStates.Locked_Show:\n Cursor.lockState = CursorLockMode.Locked;\n Cursor.visible = true;\n break;\n case CursorStates.Locked_NotShow:\n Cursor.lockState = CursorLockMode.Locked;\n Cursor.visible = false;\n break;\n }\n \n }\n}\n"),
new Tool_QuickStart_Script("DebugCommandBase", "Debug_Console", "stable", "", "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class DebugCommandBase\n{\n private string _CommandID;\n private string _CommandDescription;\n private string _CommandFormat;\n\n public string CommandID { get { return _CommandID; } }\n public string CommandDescription { get { return _CommandDescription; } }\n public string CommandFormat { get { return _CommandFormat; } }\n\n public DebugCommandBase(string id, string description, string format)\n {\n _CommandID = id;\n _CommandDescription = description;\n _CommandFormat = format;\n }\n}\n\npublic class DebugCommand : DebugCommandBase\n{\n private Action command;\n\n public DebugCommand(string id, string description, string format, Action command) : base (id, description, format)\n {\n this.command = command;\n }\n\n public void Invoke()\n {\n command.Invoke();\n }\n}\n\npublic class DebugCommand<T1> : DebugCommandBase\n{\n private Action<T1> command;\n\n public DebugCommand(string id, string description, string format, Action<T1> command) : base (id, description, format)\n {\n this.command = command;\n }\n\n public void Invoke(T1 value)\n {\n command.Invoke(value);\n }\n}\n"),
new Tool_QuickStart_Script("DebugConsole", "Debug_Console", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class DebugConsole : MonoBehaviour\n{\n private bool _ShowConsole;\n private bool _ShowHelp;\n private string _Input;\n private Vector2 _Scroll;\n\n public static DebugCommand TEST;\n public static DebugCommand HELP;\n public static DebugCommand HIDEHELP;\n public static DebugCommand<float> SETVALUE;\n\n public List<object> commandList;\n\n private void Awake()\n {\n HELP = new DebugCommand(\"help\", \"Shows a list of commands\", \"help\", () =>\n {\n _ShowHelp = !_ShowHelp;\n });\n\n HIDEHELP = new DebugCommand(\"hidehelp\", \"hide help info\", \"hidehelp\", () =>\n {\n _ShowHelp = false;\n });\n\n TEST = new DebugCommand(\"test\", \"example command\", \"test\", () =>\n {\n Debug.Log(\"test command triggered\");\n });\n\n SETVALUE = new DebugCommand<float>(\"setvalue\", \"example set value\", \"setvalue <value>\", (x) =>\n {\n Debug.Log(\"Value added: \" + x.ToString());\n });\n\n commandList = new List<object>\n { \n HELP,\n HIDEHELP,\n TEST,\n SETVALUE\n };\n }\n\n private void OnGUI()\n {\n //Check input\n if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.F1)\n {\n _ShowConsole = !_ShowConsole;\n }\n\n if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return && _ShowConsole)\n {\n HandleInput();\n _Input = \"\";\n }\n\n //Console active\n if (!_ShowConsole) return;\n\n GUI.FocusControl(\"FOCUS\");\n \n float y = 0f;\n\n if(_ShowHelp)\n {\n GUI.Box(new Rect(0, y, Screen.width, 100), \"\");\n Rect viewport = new Rect(0, 0, Screen.width - 30, 20 * commandList.Count);\n _Scroll = GUI.BeginScrollView(new Rect(0, y + 5, Screen.width, 90), _Scroll, viewport);\n\n for (int i=0; i<commandList.Count; i++)\n {\n DebugCommandBase command = commandList[i] as DebugCommandBase;\n string label = $\"{command.CommandFormat} - {command.CommandDescription}\";\n Rect labelRect = new Rect(5, 20 * i, viewport.width - 100, 20);\n GUI.Label(labelRect, label);\n }\n\n GUI.EndScrollView();\n y += 100;\n }\n\n GUI.Box(new Rect(0, y, Screen.width, 30), \"\");\n\n GUI.backgroundColor = new Color(0,0,0,0);\n GUI.SetNextControlName(\"FOCUS\");\n _Input = GUI.TextField(new Rect(10, y + 5, Screen.width - 20, 20), _Input);\n }\n\n private void HandleInput()\n {\n string[] properties = _Input.Split(' ');\n\n for(int i=0; i < commandList.Count; i++)\n {\n DebugCommandBase commandBase = commandList[i] as DebugCommandBase;\n\n if (_Input.Contains(commandBase.CommandID))\n {\n if (commandList[i] as DebugCommand != null)\n (commandList[i] as DebugCommand).Invoke();\n else if (commandList[i] as DebugCommand<int> != null && properties.Length > 1)\n if (CheckInput(properties[1]))\n (commandList[i] as DebugCommand<int>).Invoke(int.Parse(properties[1]));\n }\n }\n }\n\n private bool CheckInput(string str)\n {\n foreach (char c in str)\n {\n if (c < '0' || c > '9')\n return false;\n }\n return true;\n }\n}\n"),
new Tool_QuickStart_Script("DialogSystem", "Dialog", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.UI;\nusing TMPro;\n\npublic class DialogSystem : MonoBehaviour\n{\n [Header(\"Ref\")]\n [SerializeField] private TextMeshProUGUI _DialogText;\n [SerializeField] private Button _NextButton;\n\n [Header(\"Ref Options\")]\n [SerializeField] private List<TextMeshProUGUI> _OptionsText = new List<TextMeshProUGUI>();\n [SerializeField] private List<GameObject> _OptionsButtons = new List<GameObject>();\n\n [Header(\"Dialog\")]\n public DialogSystem_File _Dialog;\n\n //Private variables\n private Vector2Int _CurrentID = new Vector2Int(0, 0);\n private bool _Finished;\n\n void Update()\n {\n _DialogText.text = _Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Dialog;\n\n // Option Buttons \n for (int i = 0; i < _OptionsButtons.Count; i++)\n {\n if (_Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options.Count != 0)\n {\n if (i < _Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options.Count)\n {\n _OptionsButtons[i].SetActive(true);\n _OptionsText[i].text = _Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options[i].OptionInfo;\n }\n else\n _OptionsButtons[i].SetActive(false);\n }\n else\n _OptionsButtons[i].SetActive(false);\n }\n\n // NextButton\n if (_Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options != null)\n {\n if (_Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options.Count == 0)\n _NextButton.gameObject.SetActive(true);\n else\n _NextButton.gameObject.SetActive(false);\n }\n else\n _NextButton.gameObject.SetActive(false);\n\n //Done\n if(_Finished)\n {\n _NextButton.gameObject.SetActive(false);\n for (int i = 0; i < _OptionsButtons.Count; i++)\n {\n _OptionsButtons[i].SetActive(false);\n }\n _DialogText.text = \"Finished\";\n }\n }\n\n public void ButtonInput(int id)\n {\n for (int i = 0; i < _Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options[id].Options.Count; i++)\n {\n switch (_Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options[id].Options[i].Option)\n {\n case DialogSystem_DialogOption.Options.GOTO:\n _CurrentID = _Dialog.DialogTree[_CurrentID.x].Dialog[_CurrentID.y].Options[id].Options[i].NextID;\n break;\n case DialogSystem_DialogOption.Options.NEXT:\n _CurrentID.y++;\n break;\n case DialogSystem_DialogOption.Options.FINISHED:\n _Finished = true;\n break;\n }\n }\n }\n\n public void Next()\n {\n _CurrentID.y++;\n }\n}\n\n[System.Serializable]\npublic class DialogSystem_File\n{\n public string DialogNameID;\n public List<DialogSystem_DialogTree> DialogTree = new List<DialogSystem_DialogTree>();\n}\n\n[System.Serializable]\npublic class DialogSystem_DialogTree\n{\n public string DialogTreeInfo = \"\";\n public List<DialogSystem_Dialog> Dialog = new List<DialogSystem_Dialog>();\n}\n\n[System.Serializable]\npublic class DialogSystem_Dialog\n{\n public string Dialog = \"\";\n public List<DialogSystem_DialogOptions> Options = new List<DialogSystem_DialogOptions>();\n}\n\n[System.Serializable]\npublic class DialogSystem_DialogOptions\n{\n public string OptionInfo = \"\";\n public List<DialogSystem_DialogOption> Options = new List<DialogSystem_DialogOption>();\n\n [HideInInspector] public bool OptionToggle = false;\n}\n\n[System.Serializable]\npublic class DialogSystem_DialogOption\n{\n //Options\n public enum Options {GOTO, NEXT, FINISHED};\n public Options Option;\n\n //EventData\n public Vector2Int NextID = new Vector2Int();\n}\n"),
new Tool_QuickStart_Script("DialogSystemEditor", "Dialog_Editor", "stable", "", "using UnityEngine;\nusing UnityEditor;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\n\nclass DialogSystemEditor : EditorWindow\n{\n DialogSystem _Dialog;\n string _DialogLoad;\n\n Vector2 _ScrollPos_TimeLine = new Vector2();\n Vector2 _ScrollPos_Editor = new Vector2();\n\n Vector2Int _Selected = new Vector2Int();\n\n bool _SearchScript = false;\n\n [MenuItem(\"Tools/DialogSystem Editor\")]\n public static void ShowWindow()\n {\n EditorWindow.GetWindow(typeof(DialogSystemEditor));\n }\n\n void OnGUI()\n {\n if (!_SearchScript)\n _Dialog = GameObject.FindObjectOfType<DialogSystem>();\n\n GUILayout.Label(\"Dialog Editor\", EditorStyles.boldLabel);\n _Dialog = EditorGUILayout.ObjectField(_Dialog, typeof(DialogSystem), true) as DialogSystem;\n\n if (_Dialog == null)\n return;\n _Dialog._Dialog.DialogNameID = EditorGUILayout.TextField(\"DialogName\",_Dialog._Dialog.DialogNameID);\n\n EditorGUILayout.BeginHorizontal(\"box\");\n if (_Dialog != null)\n {\n //Editor\n Editor();\n\n //TimeLine\n TimeLine();\n }\n EditorGUILayout.EndHorizontal();\n }\n\n void Editor()\n {\n EditorGUILayout.BeginVertical(\"box\");\n\n //Edit\n _ScrollPos_Editor = EditorGUILayout.BeginScrollView(_ScrollPos_Editor, GUILayout.Width(325));\n if (_Selected.x >= 0)\n {\n if (_Selected.x < _Dialog._Dialog.DialogTree.Count)\n {\n if (_Selected.y < _Dialog._Dialog.DialogTree[_Selected.x].Dialog.Count)\n {\n //Dialog\n GUILayout.Label(\"Selected \" + \"ID:\" + _Selected.x.ToString() + \",\" + _Selected.y.ToString());\n _Dialog._Dialog.DialogTree[_Selected.x].DialogTreeInfo = EditorGUILayout.TextField(\"Row Info:\", _Dialog._Dialog.DialogTree[_Selected.x].DialogTreeInfo);\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Dialog = EditorGUILayout.TextArea(_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Dialog, GUILayout.Height(200), GUILayout.Width(300));\n\n //Dialog Options\n GUILayout.Label(\"Options\");\n EditorGUILayout.BeginVertical(\"box\");\n\n int optionscount = 0;\n for (int i = 0; i < _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options.Count; i++)\n {\n optionscount++;\n //Toggle\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionToggle = EditorGUILayout.Foldout(_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionToggle, \"(\" + optionscount.ToString() + \") \" + _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionInfo);\n \n //Options\n if (_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionToggle)\n {\n //Option Dialog\n GUILayout.Label(\"Option Dialog:\");\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionInfo = EditorGUILayout.TextArea(_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].OptionInfo, GUILayout.Height(100), GUILayout.Width(300));\n\n //Display options\n EditorGUILayout.BeginVertical(\"box\");\n for (int o = 0; o < _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options.Count; o++)\n {\n //Option dropdown/Remove Event\n EditorGUILayout.BeginHorizontal();\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options[o].Option = (DialogSystem_DialogOption.Options)EditorGUILayout.EnumPopup(_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options[o].Option);\n if (GUILayout.Button(\"-\", GUILayout.Width(20)))\n {\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options.RemoveAt(o);\n break;\n }\n EditorGUILayout.EndHorizontal();\n\n //Options\n switch (_Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options[o].Option)\n {\n case DialogSystem_DialogOption.Options.GOTO:\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options[o].NextID = EditorGUILayout.Vector2IntField(\"Next ID\", _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options[o].NextID);\n break;\n }\n\n }\n if (GUILayout.Button(\"Add Event\"))\n {\n DialogSystem_DialogOption newoption = new DialogSystem_DialogOption();\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options[i].Options.Add(newoption);\n }\n EditorGUILayout.EndVertical();\n }\n }\n if(GUILayout.Button(\"Add Option Dialog\"))\n {\n DialogSystem_DialogOptions newoption = new DialogSystem_DialogOptions();\n newoption.OptionInfo = \"new option\";\n _Dialog._Dialog.DialogTree[_Selected.x].Dialog[_Selected.y].Options.Add(newoption);\n }\n EditorGUILayout.EndVertical();\n }\n else\n {\n GUILayout.Label(\"Selected\");\n GUILayout.Label(\"ID: --\");\n GUILayout.Label(\"Press a button on \\nthe timeline to select!\");\n }\n }\n }\n else\n {\n GUILayout.Label(\"Selected\");\n GUILayout.Label(\"ID: --\");\n GUILayout.Label(\"Press a button on \\nthe timeline to select!\");\n }\n\n //SaveLoad\n if(GUILayout.Button(\"Save\"))\n {\n SaveData();\n }\n\n _DialogLoad = EditorGUILayout.TextField(\"Dialog Path:\", _DialogLoad);\n if (GUILayout.Button(\"Load\"))\n {\n LoadData();\n }\n\n EditorGUILayout.EndScrollView();\n EditorGUILayout.EndVertical();\n }\n\n void TimeLine()\n {\n EditorGUILayout.BeginVertical();\n _ScrollPos_TimeLine = EditorGUILayout.BeginScrollView(_ScrollPos_TimeLine);\n for (int i = 0; i < _Dialog._Dialog.DialogTree.Count; i++)\n {\n EditorGUILayout.BeginHorizontal(\"box\");\n\n // Row Options\n EditorGUILayout.BeginVertical();\n\n // ID/Remove\n EditorGUILayout.BeginHorizontal();\n if (GUILayout.Button(\"-\", GUILayout.Width(20)))\n {\n _Dialog._Dialog.DialogTree.RemoveAt(i);\n if(_Selected.x > _Dialog._Dialog.DialogTree.Count-1)\n _Selected.x--;\n break;\n }\n EditorGUILayout.EndHorizontal();\n\n // Add Dialog to timeline\n if (GUILayout.Button(\"+\", GUILayout.Width(20)))\n {\n DialogSystem_Dialog newdialog = new DialogSystem_Dialog();\n newdialog.Dialog = \"dialogtext\";\n _Dialog._Dialog.DialogTree[i].Dialog.Add(newdialog);\n }\n\n EditorGUILayout.EndVertical();\n\n //TimeLineButtons\n for (int j = 0; j < 100; j++)\n {\n EditorGUILayout.BeginVertical();\n GUILayout.Label(j.ToString());\n\n if (j < _Dialog._Dialog.DialogTree[i].Dialog.Count)\n {\n //if (GUILayout.Button(\"(\" + _Dialog.Dialog[i].DialogTree[j].Options.Count.ToString() + \") \" + _Dialog.Dialog[i].DialogTree[j].Dialog, GUILayout.Width(100), GUILayout.Height(30)))\n if (GUILayout.Button(j.ToString() + \" (\" + _Dialog._Dialog.DialogTree[i].Dialog[j].Options.Count.ToString() + \") \", GUILayout.Width(100), GUILayout.Height(30)))\n {\n _Selected = new Vector2Int(i, j);\n }\n }\n\n EditorGUILayout.EndVertical();\n }\n EditorGUILayout.EndHorizontal();\n }\n\n // Add row\n if (GUILayout.Button(\"Add Dialog Tree\", GUILayout.Width(100), GUILayout.Height(50)))\n {\n DialogSystem_DialogTree newdialogtree = new DialogSystem_DialogTree();\n DialogSystem_Dialog newdialog = new DialogSystem_Dialog();\n newdialog.Dialog = \"dialogtext\";\n newdialogtree.Dialog.Add(newdialog);\n _Dialog._Dialog.DialogTree.Add(newdialogtree);\n }\n\n EditorGUILayout.EndScrollView();\n EditorGUILayout.EndVertical();\n }\n\n //SaveLoad\n public void SaveData()\n {\n string jsonData = JsonUtility.ToJson(_Dialog._Dialog, true);\n File.WriteAllText(Application.dataPath + \"/\" + _Dialog._Dialog.DialogNameID + \".json\", jsonData);\n }\n public void LoadData()\n {\n try\n {\n string dataAsJson = File.ReadAllText(Application.dataPath + \"/\" + _DialogLoad + \".json\");\n _Dialog._Dialog = JsonUtility.FromJson<DialogSystem_File>(dataAsJson);\n }\n catch\n {\n SaveData();\n }\n }\n}\n"),
new Tool_QuickStart_Script("Disable", "Practical_Disable", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Disable : MonoBehaviour {\n\n [SerializeField] private GameObject _Object;\n\n public void DisableObject(float seconds) {\n StartCoroutine(StartDisable(seconds));\n }\n\n private IEnumerator StartDisable(float seconds)\n {\n yield return new WaitForSeconds(seconds);\n _Object.SetActive(false);\n }\n}\n"),
new Tool_QuickStart_Script("DoEvent", "Practical_Event_UnityEvent", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.Events;\nusing UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class DoEvent : MonoBehaviour\n{\n [SerializeField] private UnityEvent _Event = null;\n [SerializeField] private bool _OnStart = false;\n [SerializeField] private bool _OnUpdate = false;\n [SerializeField] private bool _OnButtonPressed = false;\n\n private bool _AsyncLoading = false;\n\n void Start()\n {\n if (_OnStart)\n DoEvents();\n }\n\n void Update()\n {\n if (_OnUpdate)\n DoEvents();\n\n if (_OnButtonPressed)\n if (Input.anyKey)\n DoEvents();\n }\n\n private void DoEvents()\n {\n _Event.Invoke();\n }\n\n //Set Object true/false\n public void SetGameobject_InActive(GameObject targetobject)\n {\n targetobject.SetActive(false);\n }\n public void SetGameobject_Active(GameObject targetobject)\n {\n targetobject.SetActive(true);\n }\n public void SetGameObject_Negative(GameObject targetobject)\n {\n if (targetobject.activeSelf)\n targetobject.SetActive(false);\n else\n targetobject.SetActive(true);\n }\n\n //Load/Reload Scenes\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n }\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n }\n public void ReloadScene()\n {\n SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);\n }\n public void AsyncReloadScene()\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(SceneManager.GetActiveScene().buildIndex));\n }\n }\n public void AsyncLoadScene(int sceneid)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(sceneid));\n }\n }\n public void AsyncLoadScene(string scenename)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(scenename));\n }\n }\n private IEnumerator LoadSceneAsync(string scenename)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(scenename);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n private IEnumerator LoadSceneAsync(int sceneid)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneid);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n\n //Quit\n public void Quit()\n {\n Application.Quit();\n }\n}\n"),
new Tool_QuickStart_Script("DoEventOnInput", "Practical_Event_UnityEvent", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.SceneManagement;\nusing UnityEngine.Events;\nusing UnityEngine;\n\npublic class DoEventOnInput : MonoBehaviour\n{\n [Header(\"Input Settings\")]\n [SerializeField] private KeyCode _InputKey;\n public enum InputOptions { GetKeyDown, GetKeyUp, GetKey }\n [SerializeField] private InputOptions _InputOption = InputOptions.GetKeyDown;\n\n [Header(\"Event\")]\n [SerializeField] private UnityEvent _Event = null;\n\n [Header(\"Other Options\")]\n [SerializeField] private bool _OnStart = false;\n [SerializeField] private bool _OnUpdate = false;\n [SerializeField] private bool _OnAnyKey = false;\n\n private bool _AsyncLoading = false;\n\n void Start()\n {\n if (_OnStart)\n DoEvents();\n }\n\n void Update()\n {\n if (_OnUpdate)\n DoEvents();\n\n if (_OnAnyKey)\n if (Input.anyKey)\n DoEvents();\n\n switch(_InputOption)\n {\n case InputOptions.GetKeyDown:\n if (Input.GetKeyDown(_InputKey))\n _Event.Invoke();\n break;\n case InputOptions.GetKeyUp:\n if (Input.GetKeyUp(_InputKey))\n _Event.Invoke();\n break;\n case InputOptions.GetKey:\n if (Input.GetKey(_InputKey))\n _Event.Invoke();\n break;\n } \n }\n\n private void DoEvents()\n {\n _Event.Invoke();\n }\n\n //Set Object true/false\n public void SetGameobject_InActive(GameObject targetobject)\n {\n targetobject.SetActive(false);\n }\n public void SetGameobject_Active(GameObject targetobject)\n {\n targetobject.SetActive(true);\n }\n public void SetGameObject_Negative(GameObject targetobject)\n {\n if (targetobject.activeSelf)\n targetobject.SetActive(false);\n else\n targetobject.SetActive(true);\n }\n\n //Load/Reload Scenes\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n }\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n }\n public void ReloadScene()\n {\n SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);\n }\n public void AsyncReloadScene()\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(SceneManager.GetActiveScene().buildIndex));\n }\n }\n public void AsyncLoadScene(int sceneid)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(sceneid));\n }\n }\n public void AsyncLoadScene(string scenename)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(scenename));\n }\n }\n private IEnumerator LoadSceneAsync(string scenename)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(scenename);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n private IEnumerator LoadSceneAsync(int sceneid)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneid);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n\n //Quit\n public void Quit()\n {\n Application.Quit();\n }\n}\n"),
new Tool_QuickStart_Script("DontDestroy", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class DontDestroy : MonoBehaviour\n{\n void Start()\n {\n DontDestroyOnLoad(this.gameObject);\n }\n}\n"),
new Tool_QuickStart_Script("EasyTime", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class EasyTime : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _Multiplier = 1;\n\n [Header(\"Info\")]\n [SerializeField] private float _TotalTime;\n [SerializeField] private float _CurrentTime;\n [SerializeField] private Vector3 _TimeData;\n [SerializeField] private int _Day;\n\n void Update()\n {\n _CurrentTime += 1 * _Multiplier * Time.deltaTime;\n _TotalTime += 1 * _Multiplier * Time.deltaTime;\n _TimeData = new Vector3(_CurrentTime % 60, Mathf.Floor((_CurrentTime / 60) % 60), Mathf.Floor(_CurrentTime / 3600));\n\n\n if(_TimeData.z >= 24)\n {\n _Day++;\n _CurrentTime = 0;\n }\n }\n\n public float CurrentTime_Float\n {\n get { return _CurrentTime; }\n set { _CurrentTime = value; }\n }\n public float TotalTime_Flaot\n {\n get { return _TotalTime; }\n set { _TotalTime = value; }\n }\n public Vector3 CurrentTime_Vector4\n {\n get { return _TimeData; }\n set { _TimeData = value; }\n }\n public int CurrentDay\n {\n get { return _Day; }\n set { _Day = value; }\n }\n}\n"),
new Tool_QuickStart_Script("EditorWindowExample", "Editor_Window", "stable", "", "using UnityEngine;\nusing UnityEditor;\nusing System.Collections;\n\nclass EditorWindowExample : EditorWindow\n{\n string examplestring = \"example\";\n bool examplebool = false;\n\n [MenuItem(\"Tools/EditorWindowExample\")]\n public static void ShowWindow()\n {\n EditorWindow.GetWindow(typeof(EditorWindowExample));\n }\n\n void OnGUI()\n {\n GUILayout.Label(\"Example Title\", EditorStyles.boldLabel);\n examplestring = EditorGUILayout.TextField(\"Example string field\", examplestring);\n examplebool = EditorGUILayout.Toggle(\"Example bool field\", examplebool);\n }\n}\n"),
new Tool_QuickStart_Script("EffectsHandler", "Effects_Volume_HDRP_Handler", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.Rendering.HighDefinition;\nusing UnityEngine;\nusing UnityEngine.Rendering;\n\npublic enum EffectOptions\n{\n chromaticabberation,\n FilmGrain,\n Vignette,\n PaniniProjection,\n LensDistorion\n};\n\npublic class EffectHandler : MonoBehaviour\n{\n [Header(\"Refs\")]\n [SerializeField] private Volume _Volume;\n\n [Header(\"Settings\")]\n [SerializeField] private float _VolumeChangeSpeed = 2;\n\n [Header(\"Volume Effects\")]\n [SerializeField] float _Default_Chromaticabberation = 0.23f;\n private float _Target_Chromaticabberation, _Current_Chromaticabberation;\n [SerializeField] float _Default_FilmGrain = 1f;\n private float _Target_FilmGrain, _Current_FilmGrain;\n [SerializeField] float _Default_Vignette = 0.5f;\n private float _Target_Vignette, _Current_Vignette;\n [SerializeField] float _Default_PaniniProjection = 0.1f;\n private float _Target_PaniniProjection, _Current_PaniniProjection;\n [SerializeField] float _Default_LensDistortion = 0f;\n private float _Target_LensDistortion, _Current_LensDistortion;\n\n [SerializeField] private Dictionary<EffectOptions, List<EffectHandler_EffectData>> _EffectTimer = new Dictionary<EffectOptions, List<EffectHandler_EffectData>>();\n\n public static EffectHandler Instance;\n\n //Volume Effects\n private ChromaticAberration _Chromaticabberation;\n private FilmGrain _FilmGrain;\n private Vignette _Vignette;\n private PaniniProjection _PaniniProjection;\n private LensDistortion _LensDistortion;\n\n\n private void Awake()\n {\n Instance = this;\n }\n\n private void Start()\n {\n // Add To Dictionary\n _EffectTimer.Add(EffectOptions.chromaticabberation, new List<EffectHandler_EffectData>());\n _EffectTimer.Add(EffectOptions.FilmGrain, new List<EffectHandler_EffectData>());\n _EffectTimer.Add(EffectOptions.Vignette, new List<EffectHandler_EffectData>());\n _EffectTimer.Add(EffectOptions.PaniniProjection, new List<EffectHandler_EffectData>());\n _EffectTimer.Add(EffectOptions.LensDistorion, new List<EffectHandler_EffectData>());\n\n\n // Get Volume Effects\n _Volume.profile.TryGet(out _Chromaticabberation);\n _Volume.profile.TryGet(out _FilmGrain);\n _Volume.profile.TryGet(out _Vignette);\n _Volume.profile.TryGet(out _PaniniProjection);\n _Volume.profile.TryGet(out _LensDistortion);\n }\n\n void Update()\n {\n foreach (EffectOptions effectType in _EffectTimer.Keys)\n {\n if (Check_EffectExist(effectType)) // Effect\n {\n switch (effectType)\n {\n case EffectOptions.chromaticabberation:\n _Target_Chromaticabberation = _EffectTimer[effectType][0].Intensity;\n break;\n case EffectOptions.FilmGrain:\n _Target_FilmGrain = _EffectTimer[effectType][0].Intensity;\n break;\n case EffectOptions.Vignette:\n _Target_Vignette = _EffectTimer[effectType][0].Intensity;\n break;\n case EffectOptions.PaniniProjection:\n _Target_PaniniProjection = _EffectTimer[effectType][0].Intensity;\n break;\n case EffectOptions.LensDistorion:\n _Target_LensDistortion = _EffectTimer[effectType][0].Intensity;\n break;\n }\n }\n else // Default\n {\n switch (effectType)\n {\n case EffectOptions.chromaticabberation:\n _Target_Chromaticabberation = _Default_Chromaticabberation;\n break;\n case EffectOptions.FilmGrain:\n _Target_FilmGrain = _Default_FilmGrain;\n break;\n case EffectOptions.Vignette:\n _Target_Vignette = _Default_Vignette;\n break;\n case EffectOptions.PaniniProjection:\n _Target_PaniniProjection = _Default_PaniniProjection;\n break;\n case EffectOptions.LensDistorion:\n _Target_LensDistortion = _Default_LensDistortion;\n break;\n }\n }\n\n for (int i = 0; i < _EffectTimer[effectType].Count; i++)\n {\n _EffectTimer[effectType][i].Timer -= 1 * Time.deltaTime;\n if (_EffectTimer[effectType][i].Timer <= 0)\n _EffectTimer[effectType].RemoveAt(i);\n }\n }\n\n\n // Update Values > Volume\n _Current_Chromaticabberation = Mathf.Lerp(_Current_Chromaticabberation, _Target_Chromaticabberation, _VolumeChangeSpeed * Time.deltaTime);\n _Current_FilmGrain = Mathf.Lerp(_Current_FilmGrain, _Target_FilmGrain, _VolumeChangeSpeed * Time.deltaTime);\n _Current_Vignette = Mathf.Lerp(_Current_Vignette, _Target_Vignette, _VolumeChangeSpeed * Time.deltaTime);\n _Current_PaniniProjection = Mathf.Lerp(_Current_PaniniProjection, _Target_PaniniProjection, _VolumeChangeSpeed * Time.deltaTime);\n _Current_LensDistortion = Mathf.Lerp(_Current_LensDistortion, _Target_LensDistortion, _VolumeChangeSpeed * Time.deltaTime);\n\n\n // Apply Volume Values\n _Chromaticabberation.intensity.value = _Current_Chromaticabberation;\n _FilmGrain.intensity.value = _Current_FilmGrain;\n _Vignette.intensity.value = _Current_Vignette;\n _PaniniProjection.distance.value = _Current_PaniniProjection;\n _LensDistortion.intensity.value = _Current_LensDistortion;\n }\n\n private bool Check_EffectExist(EffectOptions effectType)\n {\n if (_EffectTimer[effectType].Count > 0)\n return true;\n else\n return false;\n }\n\n public void ApplyEffect(EffectOptions effecttype, float intensity, float duration = 1)\n {\n if (Check_EffectExist(effecttype))\n {\n bool checkvalidoption = true;\n for (int i = 0; i < _EffectTimer[effecttype].Count; i++)\n {\n if (_EffectTimer[effecttype][i].Intensity > intensity && _EffectTimer[effecttype][i].Timer > duration)\n checkvalidoption = false;\n }\n\n if (checkvalidoption)\n {\n bool hasintensityvalue = false;\n int effectid = 0;\n for (int i = 0; i < _EffectTimer[effecttype].Count; i++)\n {\n if (_EffectTimer[effecttype][i].Intensity == intensity)\n {\n hasintensityvalue = true;\n effectid = i;\n }\n }\n if (hasintensityvalue)\n _EffectTimer[effecttype][effectid].Timer = duration;\n else\n _EffectTimer[effecttype].Add(new EffectHandler_EffectData(intensity, duration));\n }\n }\n else\n {\n _EffectTimer[effecttype].Add(new EffectHandler_EffectData(intensity, duration));\n }\n\n var sortedList = new List<EffectHandler_EffectData>(_EffectTimer[effecttype]);\n sortedList.Sort((x, y) => x.Intensity.CompareTo(y.Intensity));\n sortedList.Reverse();\n _EffectTimer[effecttype] = sortedList;\n }\n}\n\n[System.Serializable]\npublic class EffectHandler_EffectData\n{\n public float Intensity { get; set; }\n public float Timer { get; set; }\n\n public EffectHandler_EffectData(float intensity, float duration)\n {\n Intensity = intensity;\n Timer = duration;\n }\n}\n"),
new Tool_QuickStart_Script("EnemySpawnHandler", "Enemy_Spawn_Handler", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class EnemySpawnHandler : MonoBehaviour\n{\n private enum Options {Endless, Waves}\n\n [Header(\"Settings\")]\n [SerializeField] private Options _Option = Options.Endless;\n [SerializeField] private int _Seed = 0;\n [SerializeField] private bool _SetRandomSeed = true;\n\n [Header(\"Object Pool\")]\n [SerializeField] private ObjectPool _ObjectPool = null;\n\n [Header(\"Enemies\")]\n [SerializeField] private EnemySpawnHandler_Enemy[] _Enemies = null;\n\n [Header(\"SpawnLocations\")]\n [SerializeField] private Transform[] _SpawnLocations = null;\n\n [Header(\"Settings - Endless\")]\n [SerializeField] private float _SpawnRate = 5; // Seconds between spawning\n [SerializeField] private float _SpawnRateEncrease = 0.05f; // Decrease time between spawning per sec\n [SerializeField] private bool _RandomEnemy = true;\n [SerializeField] private bool _RandomSpawn = true;\n\n [Header(\"Settings - Waves\")]\n [SerializeField] private EnemySpawnHandler_WaveSettings _Waves = null;\n [SerializeField] private bool _WaitForAllEnemiesKilled = true;\n\n private float _Timer = 0;\n private int _CurrentWave = 0;\n private int _CheckWave = 999;\n private float _TimerBetweenWaves = 0;\n private float _SpawnSpeed = 0;\n\n private int _EnemiesAlive = 0;\n\n private void Start()\n {\n if (_SetRandomSeed)\n Random.InitState(Random.Range(0, 10000));\n else\n Random.InitState(_Seed);\n\n if (_Waves.WaveOption == EnemySpawnHandler_WaveSettings.WaveOptions.Generate)\n GenerateWaves();\n if (_Waves.WaveOption == EnemySpawnHandler_WaveSettings.WaveOptions.Endless)\n {\n _Waves.WaveAmount = 1;\n GenerateWaves();\n GenerateWaves(1);\n }\n }\n\n void Update()\n {\n _Timer += 1 * Time.deltaTime;\n\n switch (_Option)\n {\n case Options.Endless:\n Update_Endless();\n break;\n case Options.Waves:\n Update_Waves();\n break;\n }\n }\n\n //Update\n private void Update_Endless()\n {\n if (_Timer >= _SpawnRate)\n {\n int randomenemyid = 0;\n int randomspawnid = 0;\n if (_RandomEnemy)\n randomenemyid = Random.Range(0, _Enemies.Length);\n if (_RandomSpawn)\n randomspawnid = Random.Range(0, _SpawnLocations.Length);\n Spawn(randomenemyid, randomspawnid);\n _Timer = 0;\n }\n _SpawnRate -= _SpawnRateEncrease * Time.deltaTime;\n }\n private void Update_Waves()\n {\n if (_CurrentWave < _Waves.Waves.Count)\n {\n if (_CheckWave != _CurrentWave)\n {\n if (_WaitForAllEnemiesKilled)\n {\n EnemiesAlive();\n\n if (_EnemiesAlive == 0)\n _TimerBetweenWaves += 1 * Time.deltaTime;\n }\n else\n _TimerBetweenWaves += 1 * Time.deltaTime;\n\n if (_TimerBetweenWaves >= _Waves.TimeBetweenWaves)\n {\n _TimerBetweenWaves = 0;\n _CheckWave = _CurrentWave;\n _SpawnSpeed = _Waves.Waves[_CurrentWave].SpawnDuration / _Waves.Waves[_CurrentWave].TotalEnemies;\n if (_Waves.WaveOption == EnemySpawnHandler_WaveSettings.WaveOptions.Endless)\n GenerateWaves(_CurrentWave+2);\n }\n }\n else\n {\n //Spawn\n if (_Waves.Waves[_CurrentWave].TotalEnemies > 0)\n {\n if (_Timer > _SpawnSpeed)\n {\n bool spawncheck = false;\n while (!spawncheck)\n {\n int spawnid = Random.Range(0, _Enemies.Length);\n if (_Waves.Waves[_CurrentWave].EnemyID[spawnid] > 0)\n {\n Spawn(spawnid, Random.Range(0, _SpawnLocations.Length));\n _Waves.Waves[_CheckWave].EnemyID[spawnid]--;\n _Waves.Waves[_CurrentWave].TotalEnemies--;\n spawncheck = true;\n }\n }\n _Timer = 0;\n }\n }\n else\n {\n _CurrentWave++;\n }\n }\n }\n }\n\n //Generate Waves\n private void GenerateWaves(int waveid = 0)\n {\n int enemytypes = _Enemies.Length;\n for (int i = 0; i < _Waves.WaveAmount; i++)\n {\n EnemySpawnHandler_Wave newwave = new EnemySpawnHandler_Wave();\n int enemyamount = 0;\n\n if (waveid == 0)\n enemyamount = Mathf.RoundToInt(_Waves.EnemyAmount * ((_Waves.EnemyIncreaseAmount * i) + 1));\n else\n enemyamount = Mathf.RoundToInt(_Waves.EnemyAmount * ((_Waves.EnemyIncreaseAmount * waveid) + 1));\n\n //Set enemy amount\n newwave.EnemyID = new int[enemytypes];\n int checkenemyamount = 0;\n newwave.TotalEnemies = enemyamount;\n\n while (checkenemyamount < enemyamount)\n {\n for (int j = 0; j < enemytypes; j++)\n {\n if (_Enemies[j].StartWave <= i)\n {\n int addamount = 0;\n if (enemyamount < 2)\n addamount = Random.Range(0, enemyamount);\n else\n addamount = Random.Range(0, Mathf.RoundToInt(enemyamount*0.5f));\n\n if (enemyamount > checkenemyamount + addamount)\n {\n newwave.EnemyID[j] += addamount;\n checkenemyamount += addamount;\n }\n else\n {\n newwave.EnemyID[j] += enemyamount - checkenemyamount;\n checkenemyamount = enemyamount;\n continue;\n }\n }\n }\n }\n _Waves.Waves.Add(newwave);\n }\n }\n\n public void Spawn(int enemyid, int spawnid)\n {\n GameObject obj = _ObjectPool.GetObjectPrefabName(_Enemies[enemyid].EnemyPrefab.name, false);\n obj.transform.position = _SpawnLocations[spawnid].position;\n obj.SetActive(true);\n }\n private void EnemiesAlive()\n {\n _EnemiesAlive = GameObject.FindGameObjectsWithTag(\"Enemy\").Length;\n }\n}\n\n[System.Serializable]\npublic class EnemySpawnHandler_Enemy\n{\n public string EnemyName;\n public GameObject EnemyPrefab;\n\n [Header(\"Settings\")]\n public int StartWave;\n}\n\n[System.Serializable]\npublic class EnemySpawnHandler_WaveSettings\n{\n public enum WaveOptions {Endless, Manually, Generate}\n public WaveOptions WaveOption;\n\n [Header(\"Endless\")]\n public float EnemyIncreaseAmount;\n\n [Header(\"Manual\")]\n public List<EnemySpawnHandler_Wave> Waves;\n\n [Header(\"Generate\")]\n public int WaveAmount;\n public int EnemyAmount;\n\n [Header(\"Other\")]\n public float TimeBetweenWaves;\n}\n\n[System.Serializable]\npublic class EnemySpawnHandler_Wave\n{\n public int[] EnemyID;\n public float SpawnDuration = 5;\n\n [HideInInspector] public int TotalEnemies;\n}\n"),
new Tool_QuickStart_Script("FadeInOut", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.UI;\nusing UnityEngine;\n\npublic class FadeInOut : MonoBehaviour\n{\n private enum Fade { In, Out }\n [SerializeField] private Fade _FadeOption = Fade.In;\n [SerializeField] private float _Duration = 0;\n\n [SerializeField] private Image _Image = null;\n\n private float _ChangeSpeed;\n private Color _Color;\n\n void Start()\n {\n if (_Image == null)\n _Image = GetComponent<Image>();\n\n if (_FadeOption == Fade.In)\n _Color = new Color(_Image.color.r, _Image.color.g, _Image.color.b, 0);\n else\n _Color = new Color(_Image.color.r, _Image.color.g, _Image.color.b, 1);\n\n _ChangeSpeed = 1 / _Duration;\n }\n\n void Update()\n {\n if (_FadeOption == Fade.In && _Color.a < 1)\n {\n _Color.a += _ChangeSpeed * Time.deltaTime;\n }\n if (_FadeOption == Fade.Out && _Color.a > 0)\n {\n _Color.a -= _ChangeSpeed * Time.deltaTime;\n }\n\n _Image.color = _Color;\n }\n\n public void SetFade(bool isfadein)\n {\n if (isfadein)\n {\n _FadeOption = Fade.In;\n _Color = new Color(_Image.color.r, _Image.color.g, _Image.color.b, 0);\n }\n else\n {\n _FadeOption = Fade.Out;\n _Color = new Color(_Image.color.r, _Image.color.g, _Image.color.b, 1);\n }\n }\n}\n"),
new Tool_QuickStart_Script("Follow", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Follow : MonoBehaviour\n{\n public enum FollowOptions {MoveTowards, Lerp, SetPosition, SetParent }\n [SerializeField] private FollowOptions _Option;\n [SerializeField] private Transform _Target;\n [SerializeField] private float _FollowSpeed;\n\n private void Start()\n {\n if(_Option == FollowOptions.SetParent)\n {\n transform.parent = _Target.transform;\n transform.localPosition = Vector3.zero;\n } \n }\n\n void Update()\n {\n switch(_Option)\n {\n case FollowOptions.MoveTowards:\n transform.position = Vector3.MoveTowards(transform.position, _Target.position, _FollowSpeed * Time.deltaTime);\n break;\n case FollowOptions.Lerp:\n transform.position = Vector3.Lerp(transform.position, _Target.position, _FollowSpeed * Time.deltaTime);\n break;\n case FollowOptions.SetPosition:\n transform.position = _Target.position;\n break;\n }\n }\n}\n"),
new Tool_QuickStart_Script("Health", "Health", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.Events;\n\npublic class Health : MonoBehaviour\n{\n [SerializeField] private float _MaxHealth = 100;\n\n [SerializeField] private UnityEvent _OnDeath;\n\n private float _CurrentHealth;\n\n private void OnEnable()\n {\n _CurrentHealth = _MaxHealth;\n }\n\n public void DoDamage(float damageamount)\n {\n _CurrentHealth -= damageamount;\n if(_CurrentHealth <= 0)\n {\n _CurrentHealth = 0;\n _OnDeath.Invoke();\n gameObject.SetActive(false);\n }\n }\n\n public float GetCurrentHealth()\n {\n return _CurrentHealth;\n }\n public float GetMaxHealth()\n {\n return GetMaxHealth();\n }\n}\n"),
new Tool_QuickStart_Script("Interactable", "Interaction", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.Events;\nusing UnityEngine.UI;\n\npublic class Interactable : MonoBehaviour\n{\n public enum InteractableType { Move, Door, SetLight, SetLightNegative, Lever, Button, Item, UIButton, Trigger }\n public InteractableType _Type;\n\n private enum AxisOptions { x, y, z }\n [SerializeField] private AxisOptions _AxisOption = AxisOptions.x;\n\n [SerializeField] private bool _InvertMouse = false;\n\n [Header(\"Type - Light\")]\n [SerializeField] private GameObject _Light = null;\n [SerializeField] private bool _Light_StartOff = false;\n [Header(\"Type - Lever/Door\")]\n [SerializeField] private Transform _LeverRotationPoint = null;\n [SerializeField] private Vector2 _LeverMinMaxRotation = Vector2.zero;\n [SerializeField] private float _CompleteDeathZone = 0;\n [Header(\"Type - Button\")]\n [SerializeField] private float _ButtonPressDepth = 0;\n private bool _ButtonPressed;\n [Header(\"Type - Item\")]\n [SerializeField] private string _ItemInfo = \"\";\n [Header(\"Speed\")]\n [SerializeField] private float _Speed = 1;\n\n [Header(\"OnHigh\")]\n [SerializeField] private UnityEvent _OnHighEvent = null;\n [Header(\"OnLow\")]\n [SerializeField] private UnityEvent _OnLowEvent = null;\n [Header(\"OnNeutral\")]\n [SerializeField] private UnityEvent _OnNeutral = null;\n [Header(\"Trigger\")]\n [SerializeField] private UnityEvent _OnTrigger = null;\n\n\n private Vector3 velocity = Vector3.zero;\n private Rigidbody _RB;\n private Vector3 _DefaultLocalPosition;\n private Vector3 _DefaultRotation;\n private bool _MovingBack;\n\n private void Start()\n {\n _DefaultLocalPosition = transform.localPosition;\n _DefaultRotation = transform.eulerAngles;\n _RB = GetComponent<Rigidbody>();\n if (_Type == InteractableType.SetLight || _Type == InteractableType.SetLightNegative)\n {\n if (_Light_StartOff)\n _Light.SetActive(false);\n else\n _Light.SetActive(true);\n }\n }\n\n private void Update()\n {\n if (_Type == InteractableType.Button)\n {\n UpdateButton();\n }\n\n if (_MovingBack)\n {\n transform.eulerAngles = _DefaultRotation;\n transform.localPosition = Vector3.MoveTowards(transform.localPosition, _DefaultLocalPosition, 10 * Time.deltaTime);\n if (transform.localPosition == _DefaultLocalPosition)\n _MovingBack = false;\n }\n }\n\n public void TriggerEvent()\n {\n _OnTrigger.Invoke();\n }\n\n public InteractableType Type()\n {\n return _Type;\n }\n\n public void GotoPickupPoint(Transform point)\n {\n _RB.velocity = Vector3.zero;\n transform.position = Vector3.SmoothDamp(transform.position, point.position, ref velocity, 0.2f);\n transform.rotation = Quaternion.RotateTowards(transform.rotation, point.rotation, 5f);\n }\n public void SetVelocity(Vector3 velocity)\n {\n _RB.velocity = velocity;\n }\n public void TrowObject(Transform transformtrow)\n {\n _RB.AddForce(transformtrow.forward * 5000);\n }\n public void OpenDoor()\n {\n float mouseY = Input.GetAxis(\"Mouse Y\");\n float angle = 0;\n switch (_AxisOption)\n {\n case AxisOptions.x:\n angle = _LeverRotationPoint.localEulerAngles.x;\n break;\n case AxisOptions.y:\n angle = _LeverRotationPoint.localEulerAngles.y;\n break;\n case AxisOptions.z:\n angle = _LeverRotationPoint.localEulerAngles.z;\n break;\n }\n angle = (angle > 180) ? angle - 360 : angle;\n\n HandleRotation(_LeverRotationPoint, new Vector2(0, mouseY), _LeverMinMaxRotation, 1.2f, angle);\n }\n public void MoveLever()\n {\n float mouseY = Input.GetAxis(\"Mouse Y\");\n float angle = 0;\n switch (_AxisOption)\n {\n case AxisOptions.x:\n angle = _LeverRotationPoint.localEulerAngles.x;\n break;\n case AxisOptions.y:\n angle = _LeverRotationPoint.localEulerAngles.y;\n break;\n case AxisOptions.z:\n angle = _LeverRotationPoint.localEulerAngles.z;\n break;\n }\n angle = (angle > 180) ? angle - 360 : angle;\n\n HandleRotation(_LeverRotationPoint, new Vector2(0, mouseY), _LeverMinMaxRotation, 1.2f, angle);\n\n //Check\n if (angle < _LeverMinMaxRotation.x + _CompleteDeathZone)\n {\n _OnLowEvent.Invoke();\n }\n if (angle > _LeverMinMaxRotation.y - _CompleteDeathZone)\n {\n _OnHighEvent.Invoke();\n }\n if (angle > _LeverMinMaxRotation.x + _CompleteDeathZone && angle < _LeverMinMaxRotation.y - _CompleteDeathZone)\n {\n _OnNeutral.Invoke();\n }\n }\n public void PressButton(bool option)\n {\n _ButtonPressed = true;\n }\n public void PressButtonNegative()\n {\n _ButtonPressed = !_ButtonPressed;\n }\n public void SetLight(bool option)\n {\n _Light.SetActive(option);\n }\n public void SetLightNegative()\n {\n if (_Light.activeSelf)\n _Light.SetActive(false);\n else\n _Light.SetActive(true);\n }\n public void ReturnToDefaultPos()\n {\n _MovingBack = true;\n }\n public string GetItemInfo()\n {\n return _ItemInfo;\n }\n public void PressUIButton()\n {\n _OnTrigger.Invoke();\n }\n private void HandleRotation(Transform effectedtransform, Vector2 mousemovement, Vector2 minmaxangle, float speed, float angle)\n {\n if (_InvertMouse)\n {\n mousemovement.x = mousemovement.x * -2;\n mousemovement.y = mousemovement.y * -2;\n }\n\n switch (_AxisOption)\n {\n case AxisOptions.x:\n effectedtransform.localEulerAngles += new Vector3((mousemovement.x + mousemovement.y) * speed, 0, 0);\n\n if (angle < minmaxangle.x)\n effectedtransform.localEulerAngles = new Vector3(minmaxangle.x + 0.5f, 0, 0);\n if (angle > minmaxangle.y)\n effectedtransform.localEulerAngles = new Vector3(minmaxangle.y - 0.5f, 0, 0);\n break;\n case AxisOptions.y:\n effectedtransform.localEulerAngles += new Vector3(0, (mousemovement.x + mousemovement.y) * speed, 0);\n\n if (angle < minmaxangle.x)\n effectedtransform.localEulerAngles = new Vector3(0, minmaxangle.x + 0.5f, 0);\n if (angle > minmaxangle.y)\n effectedtransform.localEulerAngles = new Vector3(0, minmaxangle.y - 0.5f, 0);\n break;\n case AxisOptions.z:\n effectedtransform.localEulerAngles += new Vector3(0, 0, (mousemovement.x + mousemovement.y) * speed);\n\n if (angle < minmaxangle.x)\n effectedtransform.localEulerAngles = new Vector3(0, 0, minmaxangle.x + 0.5f);\n if (angle > minmaxangle.y)\n effectedtransform.localEulerAngles = new Vector3(0, 0, minmaxangle.y - 0.5f);\n break;\n }\n }\n\n private void UpdateButton()\n {\n switch (_AxisOption)\n {\n case AxisOptions.x:\n if (_ButtonPressed)\n {\n if (transform.localPosition.x > _DefaultLocalPosition.x - _ButtonPressDepth)\n transform.localPosition -= new Vector3(_Speed, 0, 0) * Time.deltaTime;\n else\n {\n transform.localPosition = new Vector3(_DefaultLocalPosition.x - _ButtonPressDepth - 0.001f, transform.localPosition.y, transform.localPosition.z);\n _OnLowEvent.Invoke();\n }\n }\n else\n {\n if (transform.localPosition.x < _DefaultLocalPosition.x + _ButtonPressDepth)\n transform.localPosition += new Vector3(_Speed, 0, 0) * Time.deltaTime;\n else\n {\n transform.localPosition = new Vector3(_DefaultLocalPosition.x + _ButtonPressDepth, transform.localPosition.y, transform.localPosition.z);\n _OnHighEvent.Invoke();\n }\n\n }\n break;\n case AxisOptions.y:\n if (_ButtonPressed)\n {\n if (transform.localPosition.y > _DefaultLocalPosition.y - _ButtonPressDepth)\n transform.localPosition -= new Vector3(0, _Speed, 0) * Time.deltaTime;\n else\n {\n transform.localPosition = new Vector3(_DefaultLocalPosition.x, _DefaultLocalPosition.y - _ButtonPressDepth - 0.001f, _DefaultLocalPosition.z);\n _OnLowEvent.Invoke();\n }\n }\n else\n {\n if (transform.localPosition.y < _DefaultLocalPosition.y)\n transform.localPosition += new Vector3(0, _Speed, 0) * Time.deltaTime;\n else\n {\n transform.localPosition = _DefaultLocalPosition;\n _OnHighEvent.Invoke();\n }\n }\n break;\n case AxisOptions.z:\n if (_ButtonPressed)\n {\n if (transform.localPosition.z > _DefaultLocalPosition.z - _ButtonPressDepth)\n transform.localPosition -= new Vector3(0, 0, _Speed) * Time.deltaTime;\n else\n {\n transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, _DefaultLocalPosition.z - _ButtonPressDepth - 0.001f);\n _OnLowEvent.Invoke();\n }\n }\n else\n {\n if (transform.localPosition.z < _DefaultLocalPosition.z + _ButtonPressDepth)\n transform.localPosition += new Vector3(0, 0, _Speed) * Time.deltaTime;\n else\n {\n transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, _DefaultLocalPosition.z + _ButtonPressDepth);\n _OnHighEvent.Invoke();\n }\n }\n break;\n }\n }\n}\n"),
new Tool_QuickStart_Script("InteractionHandler", "Interaction_Handler", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.UI;\nusing TMPro;\n\npublic class InteractionHandler : MonoBehaviour\n{\n [Header(\"Range\")]\n [SerializeField] private float _Range = 3;\n\n [Header(\"Refs\")]\n [SerializeField] private Image _Cursor = null;\n [SerializeField] private LayerMask _LayerMask = 0;\n [SerializeField] private Transform _Head = null;\n\n [Header(\"Pickup\")]\n [SerializeField] private GameObject _PickupPoint = null;\n [SerializeField] private Vector2 _PickupMinMaxRange = Vector2.zero;\n\n [Header(\"Item\")]\n [SerializeField] private Transform _ItemPreviewPoint = null;\n [SerializeField] private TextMeshProUGUI _ItemInfoText = null;\n\n [Header(\"Visual Settings\")]\n [SerializeField] private Color _Cursor_DefaultColor = new Vector4(0.3f,0.3f,0.3f,0.4f);\n [SerializeField] private Color _Cursor_InteractColor = new Vector4(1f, 1f, 1f, 1f);\n [SerializeField] private float _Cursor_Increase = 1.5f;\n [SerializeField] private float _Cursor_Increase_ChangeSpeed = 20;\n\n private string _ItemInfo;\n\n private Vector3 _PickupPointPosition;\n private Vector3 _CalcVelocity;\n private Vector3 _PrevPosition;\n\n private GameObject _ActiveObject;\n private GameObject _CheckObject;\n private Interactable _Interactable;\n\n private bool _Interacting;\n private bool _Previewing;\n\n\n private float _DefaultSize;\n\n private Movement_CC_FirstPerson _CCS; //Script that handles rotation\n\n void Start()\n {\n _CCS = GetComponent<Movement_CC_FirstPerson>();\n _PickupPointPosition.z = _PickupMinMaxRange.x;\n\n _DefaultSize = _Cursor.transform.localScale.x;\n }\n\n void Update()\n {\n if (!_Interacting)\n {\n RaycastHit hit;\n\n if (Physics.Raycast(_Head.position, _Head.TransformDirection(Vector3.forward), out hit, _Range, _LayerMask))\n {\n Debug.DrawRay(_Head.position, _Head.TransformDirection(Vector3.forward) * hit.distance, Color.yellow);\n\n _ActiveObject = hit.transform.gameObject;\n\n _Cursor.color = _Cursor_InteractColor;\n\n _Cursor.transform.localScale = Vector3.Lerp(_Cursor.transform.localScale, new Vector3(_DefaultSize * _Cursor_Increase,\n _DefaultSize * _Cursor_Increase,\n _DefaultSize * _Cursor_Increase), _Cursor_Increase_ChangeSpeed * Time.deltaTime);\n }\n else\n {\n Debug.DrawRay(_Head.position, _Head.TransformDirection(Vector3.forward) * _Range, Color.white);\n _Cursor.color = _Cursor_DefaultColor;\n\n _ActiveObject = null;\n _CheckObject = null;\n\n _Cursor.transform.localScale = Vector3.Lerp(_Cursor.transform.localScale, new Vector3(_DefaultSize,\n _DefaultSize,\n _DefaultSize), _Cursor_Increase_ChangeSpeed * Time.deltaTime);\n }\n\n if (_ActiveObject != _CheckObject)\n {\n _Interactable = _ActiveObject.GetComponent<Interactable>();\n _CheckObject = _ActiveObject;\n }\n }\n\n if (_ActiveObject != null && _Interactable != null)\n {\n if (_Interactable._Type != Interactable.InteractableType.Item)\n {\n //OnDown\n if (Input.GetMouseButtonDown(0))\n OnDown();\n\n if (_Interacting)\n {\n //OnUp\n if (Input.GetMouseButtonUp(0))\n OnUp();\n\n //OnActive\n OnActive();\n }\n }\n else\n {\n if (!_Previewing)\n {\n //Start Preview\n if (Input.GetKeyDown(KeyCode.E))\n {\n _ItemInfo = _Interactable.GetItemInfo();\n _CCS.LockRotation(true);\n _Previewing = true;\n }\n }\n else\n {\n _ActiveObject.transform.position = _ItemPreviewPoint.position;\n _Interactable.gameObject.transform.eulerAngles += new Vector3(-Input.GetAxis(\"Mouse Y\"), Input.GetAxis(\"Mouse X\"), 0);\n\n //Reset Preview\n if (Input.GetKeyDown(KeyCode.E))\n {\n _ItemInfo = \"\";\n _CCS.LockRotation(false);\n _Interactable.ReturnToDefaultPos();\n _Previewing = false;\n }\n }\n }\n }\n\n _ItemInfoText.text = _ItemInfo;\n }\n\n void FixedUpdate()\n {\n if (_Interacting)\n {\n OnActiveFixed();\n OnActiveFixed();\n }\n }\n\n private void OnUp()\n {\n _Interacting = false;\n switch (_Interactable._Type)\n {\n case Interactable.InteractableType.Lever:\n _CCS.LockRotation(false);\n break;\n case Interactable.InteractableType.Door:\n _CCS.LockRotation(false);\n break;\n case Interactable.InteractableType.Move:\n _Interactable.SetVelocity(_CalcVelocity);\n break;\n }\n }\n private void OnDown()\n {\n _Interacting = true;\n\n //OnClick\n switch (_Interactable._Type)\n {\n case Interactable.InteractableType.SetLight:\n _Interactable.SetLight(true);\n break;\n case Interactable.InteractableType.SetLightNegative:\n _Interactable.SetLightNegative();\n break;\n case Interactable.InteractableType.Move:\n _PickupPoint.transform.rotation = _ActiveObject.transform.rotation;\n _PickupPointPosition.z = Vector3.Distance(_Head.position, _ActiveObject.transform.position);\n break;\n case Interactable.InteractableType.Lever:\n _CCS.LockRotation(true);\n _PickupPointPosition.z = Vector3.Distance(_Head.position, _ActiveObject.transform.position);\n break;\n case Interactable.InteractableType.Door:\n _CCS.LockRotation(true);\n break;\n case Interactable.InteractableType.Button:\n _Interactable.PressButtonNegative();\n break;\n case Interactable.InteractableType.UIButton:\n _Interactable.PressUIButton();\n break;\n case Interactable.InteractableType.Trigger:\n _Interactable.TriggerEvent();\n break;\n }\n }\n private void OnActive()\n {\n switch (_Interactable._Type)\n {\n case Interactable.InteractableType.Move:\n if (_PickupPointPosition.z < _PickupMinMaxRange.y && Input.mouseScrollDelta.y > 0)\n _PickupPointPosition.z += Input.mouseScrollDelta.y * 0.5f;\n if (_PickupPointPosition.z > _PickupMinMaxRange.x && Input.mouseScrollDelta.y < 0)\n _PickupPointPosition.z += Input.mouseScrollDelta.y * 0.5f;\n\n if (Input.GetMouseButtonDown(1))\n {\n _Interactable.TrowObject(_Head.transform);\n OnUp();\n }\n break;\n case Interactable.InteractableType.Door:\n _Interactable.OpenDoor();\n break;\n case Interactable.InteractableType.Lever:\n _Interactable.MoveLever();\n break;\n }\n\n if (Vector3.Distance(_Head.transform.position, _ActiveObject.transform.position) > _Range)\n {\n _Interacting = false;\n OnUp();\n }\n }\n\n private void OnActiveFixed()\n {\n switch (_Interactable._Type)\n {\n case Interactable.InteractableType.Move:\n _Interactable.GotoPickupPoint(_PickupPoint.transform);\n\n _PickupPoint.transform.localPosition = _PickupPointPosition;\n\n _CalcVelocity = (_ActiveObject.transform.position - _PrevPosition) / Time.deltaTime;\n _PrevPosition = _ActiveObject.transform.position;\n break;\n }\n }\n}\n"),
new Tool_QuickStart_Script("LightEffects", "Light_Effect", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class LightEffects : MonoBehaviour\n{\n public enum LightEffectOptions { Flickering, Off, On };\n\n [Header(\"Settings\")]\n [SerializeField] private LightEffectOptions _LightEffectOption = LightEffectOptions.Flickering;\n [SerializeField] private Vector2 _MinMaxIncrease = new Vector2(0.8f, 1.2f);\n [Range(0.01f, 100)] [SerializeField] private float _EffectStrength = 50;\n\n Queue<float> _LightFlickerQ;\n private float _LastSum = 0;\n private Light _Light;\n private float _LightIntensity = 0;\n\n public void Reset()\n {\n if (_LightEffectOption == LightEffectOptions.Flickering)\n {\n _LightFlickerQ.Clear();\n _LastSum = 0;\n }\n }\n\n void Start()\n {\n _Light = GetComponent<Light>();\n _LightIntensity = _Light.intensity;\n _LightFlickerQ = new Queue<float>(Mathf.RoundToInt(_EffectStrength));\n }\n\n void Update()\n {\n switch(_LightEffectOption)\n {\n case LightEffectOptions.Flickering:\n while (_LightFlickerQ.Count >= _EffectStrength)\n _LastSum -= _LightFlickerQ.Dequeue();\n\n float newVal = Random.Range(_LightIntensity * _MinMaxIncrease.x, _LightIntensity * _MinMaxIncrease.y);\n _LightFlickerQ.Enqueue(newVal);\n _LastSum += newVal;\n _Light.intensity = _LastSum / (float)_LightFlickerQ.Count;\n break;\n case LightEffectOptions.Off:\n _Light.intensity = 0;\n break;\n case LightEffectOptions.On:\n _Light.intensity = _LightIntensity = _MinMaxIncrease.x;\n break;\n }\n\n }\n\n public void SetEffect(LightEffectOptions options)\n {\n _LightEffectOption = options;\n }\n\n public void ChangeLightIntensity(float amount)\n {\n _MinMaxIncrease.x += amount * Time.deltaTime;\n if (_MinMaxIncrease.x < 0)\n _MinMaxIncrease.x = 0;\n }\n}\n"),
new Tool_QuickStart_Script("LoadScenes", "Load_Scenes", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.SceneManagement;\nusing UnityEngine;\n\npublic class LoadScenes : MonoBehaviour\n{\n private bool _AsyncLoading = false;\n\n //Load/Reload Scenes\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n }\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n }\n public void ReloadScene()\n {\n SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);\n }\n public void AsyncReloadScene()\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(SceneManager.GetActiveScene().buildIndex));\n }\n }\n public void AsyncLoadScene(int sceneid)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(sceneid));\n }\n }\n public void AsyncLoadScene(string scenename)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(scenename));\n }\n }\n private IEnumerator LoadSceneAsync(string scenename)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(scenename);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n private IEnumerator LoadSceneAsync(int sceneid)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneid);\n\n while (!asyncLoad.isDone)\n {\n yield return null;\n }\n }\n\n //Quit\n public void QuitApplication()\n {\n Application.Quit();\n }\n}\n"),
new Tool_QuickStart_Script("LoadScenesWithLoadingBar", "Load_Scenes_LoadingBar", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.SceneManagement;\nusing UnityEngine;\nusing TMPro;\n\npublic class LoadScenesWithLoadingBar : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private TextMeshProUGUI _LoadingText;\n [SerializeField] private RectTransform _LoadingBarRect;\n\n private Vector2 _LoadingBarSize = Vector2.zero;\n private bool _AsyncLoading = false;\n\n private void Start()\n {\n _LoadingBarSize = _LoadingBarRect.sizeDelta;\n }\n\n //Load/Reload Scenes\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n }\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n }\n public void ReloadScene()\n {\n SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);\n }\n public void AsyncReloadScene()\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(SceneManager.GetActiveScene().buildIndex));\n }\n }\n public void AsyncLoadScene(int sceneid)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(sceneid));\n }\n }\n public void AsyncLoadScene(string scenename)\n {\n if (!_AsyncLoading)\n {\n _AsyncLoading = true;\n StartCoroutine(LoadSceneAsync(scenename));\n }\n }\n private IEnumerator LoadSceneAsync(string scenename)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(scenename);\n\n while (!asyncLoad.isDone)\n {\n _LoadingText.text = (asyncLoad.progress * 100).ToString(\"0\") + \"%\";\n _LoadingBarRect.sizeDelta = new Vector2(asyncLoad.progress * _LoadingBarSize.x, _LoadingBarSize.y);\n yield return null;\n }\n }\n private IEnumerator LoadSceneAsync(int sceneid)\n {\n AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneid);\n\n while (!asyncLoad.isDone)\n {\n _LoadingText.text = (asyncLoad.progress * 100).ToString(\"0\") + \"%\";\n _LoadingBarRect.sizeDelta = new Vector2(asyncLoad.progress * _LoadingBarSize.x, _LoadingBarSize.y);\n yield return null;\n }\n }\n\n //Quit\n public void QuitApplication()\n {\n Application.Quit();\n }\n}\n"),
new Tool_QuickStart_Script("Load_External_AudioFile", "Load_External_Audio", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing UnityEngine;\n\npublic class Load_External_AudioFile : MonoBehaviour\n{\n private string _Path = \"\";\n\n [Header(\"Audio\")]\n [SerializeField] private List<AudioClip> _AudioFiles = new List<AudioClip>();\n private string[] _Files_Audio_MP3;\n private string pathPreFix = @\"file://\";\n\n void Start()\n {\n _Files_Audio_MP3 = System.IO.Directory.GetFiles(_Path, \"*.mp3\");\n StartCoroutine(LoadAudio());\n }\n\n private IEnumerator LoadAudio()\n {\n //Load mp3\n foreach (string tstring in _Files_Audio_MP3)\n {\n string temppath = pathPreFix + tstring;\n\n WWW www = new WWW(temppath);\n yield return www;\n\n AudioClip audioclip = www.GetAudioClip(false, false);\n audioclip.LoadAudioData();\n audioclip.name = Path.GetFileNameWithoutExtension(temppath);\n\n _AudioFiles.Add(audioclip);\n }\n }\n}\n"),
new Tool_QuickStart_Script("Load_External_Image", "Load_External_Image", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Load_External_Image : MonoBehaviour\n{\n private string _Path = \"\";\n\n [Header(\"JPG\")]\n [SerializeField] private List<Texture2D> _Images = new List<Texture2D>();\n private string[] _Files_JPG;\n private string pathPreFix = @\"file://\";\n\n void Start()\n {\n _Files_JPG = System.IO.Directory.GetFiles(_Path, \"*.jpg\");\n StartCoroutine(LoadImages());\n }\n\n private IEnumerator LoadImages()\n {\n //Load JPG\n foreach (string tstring in _Files_JPG)\n {\n string pathTemp = pathPreFix + tstring;\n WWW www = new WWW(pathTemp);\n yield return www;\n Texture2D texTmp = new Texture2D(1024, 1024, TextureFormat.DXT1, false);\n www.LoadImageIntoTexture(texTmp);\n\n _Images.Add(texTmp);\n }\n }\n}\n"),
new Tool_QuickStart_Script("LookAtTarget", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class LookAtTarget : MonoBehaviour\n{\n [SerializeField] private Transform _Target;\n\n void Update()\n {\n transform.LookAt(_Target);\n }\n}\n"),
new Tool_QuickStart_Script("MenuHandler", "Menu_Handler", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class MenuHandler : MonoBehaviour\n{\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n }\n\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n }\n\n public int Get_CurrentSceneID()\n {\n return SceneManager.GetActiveScene().buildIndex;\n }\n\n public string Get_CurrentSceneName()\n {\n return SceneManager.GetActiveScene().name;\n }\n\n public void QuitGame()\n {\n Application.Quit();\n }\n}\n"),
new Tool_QuickStart_Script("Movement_2D_Platformer", "Movement_2D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(Rigidbody2D))]\npublic class Movement_2D_Platformer : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _NormalSpeed = 5;\n [SerializeField] private float _SprintSpeed = 8;\n [SerializeField] private float _JumpSpeed = 300;\n [SerializeField] private float _GroundCheck = 0.6f;\n [Header(\"Set ground layer\")]\n [SerializeField] private LayerMask _GroundMask = ~1;\n\n private float _Speed = 0;\n private Rigidbody2D _RB;\n\n void Start()\n {\n //Get Rigidbody / Lock z rotation\n _RB = GetComponent<Rigidbody2D>();\n _RB.constraints = RigidbodyConstraints2D.FreezeRotation;\n }\n\n void Update()\n {\n //Sprint\n if (Input.GetKey(KeyCode.LeftShift))\n _Speed = _SprintSpeed;\n else\n _Speed = _NormalSpeed;\n\n //Jumping\n if (Input.GetButtonDown(\"Jump\") && IsGrounded())\n _RB.AddForce(new Vector2(0, _JumpSpeed));\n\n //Apply Movement\n _RB.velocity = new Vector2(Input.GetAxis(\"Horizontal\") * _Speed, _RB.velocity.y);\n }\n\n bool IsGrounded()\n {\n RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, _GroundCheck, _GroundMask);\n if (hit.collider != null)\n {\n return true;\n }\n return false;\n }\n}\n"),
new Tool_QuickStart_Script("Movement_2D_TopDown", "Movement_2D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(Rigidbody2D))]\npublic class Movement_2D_TopDown : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _NormalSpeed = 5;\n [SerializeField] private float _SprintSpeed = 8;\n\n private float _Speed = 0;\n private Rigidbody2D _RB;\n\n void Start()\n {\n //Get Rigidbody / Lock z rotation\n _RB = GetComponent<Rigidbody2D>();\n _RB.constraints = RigidbodyConstraints2D.FreezeRotation;\n _RB.gravityScale = 0;\n }\n\n void Update()\n {\n //Sprint\n if (Input.GetKey(KeyCode.LeftShift))\n _Speed = _SprintSpeed;\n else\n _Speed = _NormalSpeed;\n\n //Apply Movement\n _RB.velocity = new Vector2(Input.GetAxis(\"Horizontal\") * _Speed, Input.GetAxis(\"Vertical\") * _Speed);\n }\n}\n"),
new Tool_QuickStart_Script("Movement_Camera", "Movement_3D_Camera", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Movement_Camera : MonoBehaviour\n{\n private enum CameraOptionsPos { None, Follow }\n private enum CameraOptionsRot { None, Follow }\n\n [Header(\"Options\")]\n [SerializeField] private Transform _Target = null;\n [SerializeField] private CameraOptionsPos _CameraOptionPos = CameraOptionsPos.Follow;\n [SerializeField] private CameraOptionsRot _CameraOptionRot = CameraOptionsRot.Follow;\n\n [Header(\"Offset\")]\n [SerializeField] private Vector3 _OffsetPosition = new Vector3(0, 12, -4);\n [SerializeField] private Vector3 _OffsetRotation = Vector3.zero;\n\n [Header(\"Settings\")]\n [SerializeField] private float _Speed = 3;\n [SerializeField] private bool _LerpPosition = true;\n\n [Header(\"Contraints\")]\n [SerializeField] private bool _LockAxis_X = false;\n [SerializeField] private bool _LockAxis_Y = false;\n [SerializeField] private bool _LockAxis_Z = false;\n\n private Vector3 _TargetPosition;\n private float _ScreenShakeDuration;\n private float _ScreenShakeIntensity;\n\n //CutScenes\n private bool _CutScene;\n private GameObject _CutSceneTarget;\n private Vector3 _CutScenePosition;\n private Vector3 _CutSceneRotation;\n private bool _CutSceneFollow;\n\n public static Movement_Camera CAM;\n\n private void Awake()\n {\n CAM = this;\n }\n\n void Update()\n {\n //Update Target Location\n float x_axis = _Target.transform.position.x + _OffsetPosition.x;\n float y_axis = _Target.transform.position.y + _OffsetPosition.y;\n float z_axis = _Target.transform.position.z + _OffsetPosition.z;\n\n if (!_CutScene)\n {\n //Lock Axis\n if (_LockAxis_X)\n x_axis = _OffsetPosition.x;\n if (_LockAxis_Y)\n y_axis = _OffsetPosition.y;\n if (_LockAxis_Z)\n z_axis = _OffsetPosition.z;\n\n _TargetPosition = new Vector3(x_axis, y_axis, z_axis);\n\n //Movement\n switch (_CameraOptionPos)\n {\n case CameraOptionsPos.Follow:\n if (_LerpPosition)\n transform.position = Vector3.Lerp(transform.position, _TargetPosition, _Speed * Time.deltaTime);\n else\n transform.position = Vector3.MoveTowards(transform.position, _TargetPosition, _Speed * Time.deltaTime);\n break;\n }\n\n //ScreenShake\n if (_ScreenShakeDuration > 0)\n {\n transform.localPosition = new Vector3(transform.position.x + Random.insideUnitSphere.x * _ScreenShakeIntensity, transform.position.y + Random.insideUnitSphere.y * _ScreenShakeIntensity, transform.position.z);\n _ScreenShakeDuration -= 1 * Time.deltaTime;\n }\n else\n {\n // Rotation\n switch (_CameraOptionRot)\n {\n case CameraOptionsRot.Follow:\n Vector3 rpos = _Target.position - transform.position;\n Quaternion lookrotation = Quaternion.LookRotation(rpos, Vector3.up);\n transform.eulerAngles = new Vector3(lookrotation.eulerAngles.x + _OffsetRotation.x, lookrotation.eulerAngles.y + _OffsetRotation.y, lookrotation.eulerAngles.z + _OffsetRotation.z);\n break;\n }\n }\n }\n else //CutScene\n {\n //Position\n _TargetPosition = _CutScenePosition;\n\n if (_LerpPosition)\n transform.position = Vector3.Lerp(transform.position, _TargetPosition, _Speed * Time.deltaTime);\n else\n transform.position = Vector3.MoveTowards(transform.position, _TargetPosition, _Speed * Time.deltaTime);\n\n //Target\n if (_CutSceneFollow)\n {\n Vector3 rpos = _CutSceneTarget.transform.position - transform.position;\n Quaternion lookrotation = Quaternion.LookRotation(rpos, Vector3.up);\n transform.eulerAngles = new Vector3(lookrotation.eulerAngles.x + _CutSceneRotation.x, lookrotation.eulerAngles.y + _CutSceneRotation.y, lookrotation.eulerAngles.z + _CutSceneRotation.z);\n }\n else\n transform.eulerAngles = _CutSceneRotation;\n }\n }\n\n //Effects\n public void Effect_ScreenShake(float duration, float intesity)\n {\n _ScreenShakeDuration = duration;\n _ScreenShakeIntensity = intesity;\n }\n\n //GetSet\n public Transform CameraTarget\n {\n get { return _Target; }\n set { _Target = value; }\n }\n public Vector3 Camera_OffSetPosition\n {\n get { return _OffsetPosition; }\n set { _OffsetPosition = value; }\n }\n public Vector3 Camera_OffSetRotation\n {\n get { return _OffsetRotation; }\n set { _OffsetRotation = value; }\n }\n\n //CutScene\n public void CutScene(bool startcutscene)\n {\n _CutScene = false;\n }\n public void CutScene(bool startcutscene, Vector3 cutscenepos, GameObject targetobj, Vector3 cutscenerot, bool follow)\n {\n _CutScene = startcutscene;\n _CutScenePosition = cutscenepos;\n _CutSceneTarget = targetobj;\n _CutSceneRotation = cutscenerot;\n _CutSceneFollow = follow;\n }\n}\n"),
new Tool_QuickStart_Script("Movement_Camera_CutScenes", "Movement_Camera_CutScenes_3D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Movement_Camera_CutScenes : MonoBehaviour\n{\n [SerializeField] private List<Movement_Camera_CutScene> _CutScenes = new List<Movement_Camera_CutScene>();\n [SerializeField] private LayerMask _TargetLayer;\n\n private int _Current_CutScene;\n private bool _HasCutScenes;\n\n [Header(\"Debug Gizmos\")]\n [SerializeField] private int _Gizmos_Current_CutScene;\n\n private void Start()\n {\n for (int i = 0; i < _CutScenes.Count; i++)\n {\n if (_CutScenes[i].OnTrigger)\n {\n _HasCutScenes = true;\n break;\n }\n }\n }\n\n void Update()\n {\n //If OnTrigger\n if (_HasCutScenes)\n for (int i = 0; i < _CutScenes.Count; i++)\n {\n if (_CutScenes[i].OnTrigger)\n {\n if (_CutScenes[i].CurrrentScene < _CutScenes[i].CutScene_Scenes.Count)\n {\n int detectplayer = Physics.BoxCastAll(_CutScenes[i].CutSceneTriggerPos.position, _CutScenes[i].Size, transform.forward, Quaternion.identity, 1, _TargetLayer).Length;\n\n if (detectplayer > 0)\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n else\n Movement_Camera.CAM.CutScene(false);\n }\n }\n }\n }\n\n public void NextScene()\n {\n _CutScenes[_Current_CutScene].CurrrentScene++;\n if (_CutScenes[_Current_CutScene].CurrrentScene < _CutScenes[_Current_CutScene].CutScene_Scenes.Count)\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n else\n {\n if (_CutScenes[_Current_CutScene].CutSceneOption == Movement_Camera_CutScene.CutSceneOptions.Stop)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = _CutScenes[_Current_CutScene].CutScene_Scenes.Count - 1;\n Movement_Camera.CAM.CutScene(false);\n }\n else\n {\n _CutScenes[_Current_CutScene].CurrrentScene = 0;\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n } \n }\n }\n\n public void PreviousScene()\n {\n _CutScenes[_Current_CutScene].CurrrentScene--;\n if (_CutScenes[_Current_CutScene].CurrrentScene >= 0)\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n else\n {\n if (_CutScenes[_Current_CutScene].CutSceneOption == Movement_Camera_CutScene.CutSceneOptions.Stop)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = 0;\n Movement_Camera.CAM.CutScene(false);\n }\n else\n {\n _CutScenes[_Current_CutScene].CurrrentScene = _CutScenes[_Current_CutScene].CutScene_Scenes.Count -1;\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n }\n }\n }\n\n //Set Cutscene\n public void Set_CutScene(int cutsceneid)\n {\n _Current_CutScene = cutsceneid;\n }\n public void Set_CutScene(string cutscenename)\n {\n for (int i = 0; i < _CutScenes.Count; i++)\n {\n if(cutscenename == _CutScenes[i].CutScene_Name)\n {\n _Current_CutScene = i;\n break;\n }\n }\n }\n\n //Set Scene\n public void Set_Scene(int sceneid)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = sceneid;\n }\n public void Set_Scene(string scenename)\n {\n for (int i = 0; i < _CutScenes[_Current_CutScene].CutScene_Scenes.Count; i++)\n {\n if(scenename == _CutScenes[_Current_CutScene].CutScene_Scenes[i].Scene_Name)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = i;\n break;\n }\n }\n }\n public void Set_Scene(int sceneid, bool startscene)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = sceneid;\n if (startscene)\n Start_CutScene();\n }\n public void Set_Scene(string scenename, bool startscene)\n {\n for (int i = 0; i < _CutScenes[_Current_CutScene].CutScene_Scenes.Count; i++)\n {\n if (scenename == _CutScenes[_Current_CutScene].CutScene_Scenes[i].Scene_Name)\n {\n _CutScenes[_Current_CutScene].CurrrentScene = i;\n if (startscene)\n Start_CutScene();\n break;\n }\n }\n }\n\n //Start / Stop Scene\n public void Start_CutScene()\n {\n Movement_Camera.CAM.CutScene(true, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutScenePosition, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneTarget, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].CutSceneRotation, _CutScenes[_Current_CutScene].CutScene_Scenes[_CutScenes[_Current_CutScene].CurrrentScene].FollowTarget);\n }\n public void Stop_CutScene()\n {\n Movement_Camera.CAM.CutScene(false);\n }\n\n private void OnDrawGizmosSelected()\n {\n if (_Gizmos_Current_CutScene < _CutScenes.Count)\n {\n //Trigger Position\n Gizmos.color = new Vector4(0, 1, 0, 0.2f);\n if (_CutScenes[_Gizmos_Current_CutScene].OnTrigger)\n Gizmos.DrawCube(_CutScenes[_Gizmos_Current_CutScene].CutSceneTriggerPos.position, _CutScenes[_Gizmos_Current_CutScene].Size);\n\n //Camera Positions\n for (int i = 0; i < _CutScenes[_Gizmos_Current_CutScene].CutScene_Scenes.Count; i++)\n {\n //OnFollow / Locked\n if (_CutScenes[_Gizmos_Current_CutScene].CutScene_Scenes[i].FollowTarget)\n Gizmos.color = new Vector4(0, 1, 0, 0.2f);\n else\n Gizmos.color = new Vector4(1, 0, 0, 0.2f);\n\n //DrawCamera\n Matrix4x4 oldGizmosMatrix = Gizmos.matrix;\n Gizmos.matrix = Matrix4x4.TRS(_CutScenes[_Gizmos_Current_CutScene].CutScene_Scenes[i].CutScenePosition, Quaternion.Euler(_CutScenes[_Gizmos_Current_CutScene].CutScene_Scenes[i].CutSceneRotation), Vector4.one);\n Gizmos.DrawFrustum(Vector4.zero, 60, 10, 0.5f, 1);\n Gizmos.matrix = oldGizmosMatrix;\n Gizmos.DrawSphere(_CutScenes[_Gizmos_Current_CutScene].CutScene_Scenes[i].CutScenePosition, 0.5f);\n }\n }\n }\n}\n\n[System.Serializable]\npublic class Movement_Camera_CutScene\n{\n public string CutScene_Name;\n\n public List<Movement_Camera_CutSceneLocation> CutScene_Scenes;\n public int CurrrentScene;\n\n [Header(\"Trigger Area\")]\n public bool OnTrigger;\n public Transform CutSceneTriggerPos;\n public Vector3 Size;\n\n [Header(\"When Done\")]\n public CutSceneOptions CutSceneOption;\n public enum CutSceneOptions { Stop, Loop }\n}\n\n[System.Serializable]\npublic class Movement_Camera_CutSceneLocation\n{\n public string Scene_Name;\n\n [Header(\"CutScene Settings\")]\n public Vector3 CutScenePosition;\n public Vector3 CutSceneRotation;\n\n [Header(\"Follow Target\")]\n public bool FollowTarget;\n public GameObject CutSceneTarget;\n}\n"),
new Tool_QuickStart_Script("Movement_CC_FirstPerson", "Movement_3D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(CharacterController))]\npublic class Movement_CC_FirstPerson : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _NormalSpeed = 5;\n [SerializeField] private float _SprintSpeed = 8;\n [SerializeField] private float _JumpSpeed = 5;\n [SerializeField] private float _Gravity = 20;\n [SerializeField] private float _CameraSensitivity = 1;\n\n [Header(\"Head\")]\n [SerializeField] private Transform _Head = null;\n \n //Private Variables\n private Vector3 _MoveDirection;\n private Vector2 _LookRotation;\n private CharacterController _CC;\n private bool _LockRotation;\n private float _Speed;\n\n void Start()\n {\n Cursor.lockState = CursorLockMode.Locked;\n Cursor.visible = false;\n _CC = GetComponent<CharacterController>();\n if (_Head == null)\n _Head = transform.GetChild(0).transform;\n }\n\n void Update()\n {\n //Look around\n if (!_LockRotation)\n {\n _LookRotation.x += Input.GetAxis(\"Mouse X\") * _CameraSensitivity;\n _LookRotation.y += Input.GetAxis(\"Mouse Y\") * _CameraSensitivity;\n _LookRotation.y = Mathf.Clamp(_LookRotation.y, -90, 90);\n\n transform.localRotation = Quaternion.AngleAxis(_LookRotation.x, Vector3.up);\n _Head.transform.localRotation = Quaternion.AngleAxis(_LookRotation.y, Vector3.left);\n }\n\n //Movement\n if (_CC.isGrounded)\n {\n _MoveDirection = new Vector3(Input.GetAxis(\"Horizontal\"), 0, Input.GetAxis(\"Vertical\"));\n _MoveDirection = transform.TransformDirection(_MoveDirection);\n _MoveDirection *= _Speed;\n if (Input.GetButton(\"Jump\"))\n _MoveDirection.y = _JumpSpeed;\n }\n\n //Sprint\n if (Input.GetKey(KeyCode.LeftShift))\n _Speed = _SprintSpeed;\n else\n _Speed = _NormalSpeed;\n\n //Apply Movement\n _MoveDirection.y -= _Gravity * Time.deltaTime;\n _CC.Move(_MoveDirection * Time.deltaTime);\n }\n\n public void LockRotation(bool state)\n {\n _LockRotation = state;\n }\n}\n"),
new Tool_QuickStart_Script("Movement_CC_Platformer", "Movement_3D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(CharacterController))]\npublic class Movement_CC_Platformer : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _NormalSpeed = 5, _SprintSpeed = 8;\n [SerializeField] private float _JumpSpeed = 5;\n [SerializeField] private float _Gravity = 20;\n [SerializeField] private bool _ZMovementActive = false;\n \n private Vector3 _MoveDirection = Vector3.zero;\n private float _Speed;\n private CharacterController _CC;\n\n void Start()\n {\n _CC = GetComponent<CharacterController>();\n }\n\n void Update()\n {\n //Movement\n if (_CC.isGrounded)\n {\n float verticalmovement = 0;\n if (_ZMovementActive)\n verticalmovement = Input.GetAxis(\"Vertical\");\n\n _MoveDirection = new Vector3(Input.GetAxis(\"Horizontal\"), 0, verticalmovement);\n _MoveDirection = transform.TransformDirection(_MoveDirection);\n _MoveDirection *= _Speed;\n if (Input.GetButton(\"Jump\"))\n _MoveDirection.y = _JumpSpeed;\n }\n\n //Sprint\n if (Input.GetKey(KeyCode.LeftShift))\n _Speed = _SprintSpeed;\n else\n _Speed = _NormalSpeed;\n\n //Apply Movement\n _MoveDirection.y -= _Gravity * Time.deltaTime;\n _CC.Move(_MoveDirection * Time.deltaTime);\n }\n}\n"),
new Tool_QuickStart_Script("Movement_CC_TopDown", "Movement_3D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(CharacterController))]\npublic class Movement_CC_TopDown : MonoBehaviour\n{\n //Movement\n [Header(\"Settings Camera\")]\n [SerializeField] private Camera _Camera;\n [Header(\"Settings\")]\n [SerializeField] private float _NormalSpeed = 5;\n [SerializeField] private float _SprintSpeed = 8;\n [SerializeField] private float _JumpSpeed = 5;\n [SerializeField] private float _Gravity = 20;\n [SerializeField] private bool _MovementRelativeToRotation = false;\n\n private float _Speed = 0;\n private Vector3 _MoveDirection = Vector3.zero;\n private CharacterController _CC;\n\n void Start()\n {\n _CC = GetComponent<CharacterController>();\n }\n\n void Update()\n {\n //Movement\n if (_CC.isGrounded)\n {\n _MoveDirection = new Vector3(Input.GetAxis(\"Horizontal\"), 0, Input.GetAxis(\"Vertical\"));\n if (_MovementRelativeToRotation)\n _MoveDirection = transform.TransformDirection(_MoveDirection);\n _MoveDirection *= _Speed;\n if (Input.GetButton(\"Jump\"))\n _MoveDirection.y = _JumpSpeed;\n }\n\n _MoveDirection.y -= _Gravity * Time.deltaTime;\n _CC.Move(_MoveDirection * Time.deltaTime);\n\n //Sprint\n if (Input.GetKey(KeyCode.LeftShift))\n _Speed = _SprintSpeed;\n else\n _Speed = _NormalSpeed;\n\n Ray cameraRay = _Camera.ScreenPointToRay(Input.mousePosition);\n Plane groundPlane = new Plane(Vector3.up, Vector3.zero);\n float rayLength;\n if (groundPlane.Raycast(cameraRay, out rayLength))\n {\n Vector3 pointToLook = cameraRay.GetPoint(rayLength);\n transform.LookAt(new Vector3(pointToLook.x, transform.position.y, pointToLook.z));\n }\n }\n\n public void SetCamera(Camera cameraobj)\n {\n _Camera = cameraobj;\n }\n}\n"),
new Tool_QuickStart_Script("Movement_FreeCamera", "Movement_3D_Camera", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Movement_FreeCamera : MonoBehaviour\n{\n [SerializeField] private float _Speed = 5;\n [SerializeField] private float _SprintSpeed = 8;\n\n private float _CurrentSpeed;\n\n void Start()\n {\n Cursor.visible = false;\n Cursor.lockState = CursorLockMode.Locked;\n }\n\n void Update()\n {\n if (Input.GetKey(KeyCode.LeftShift))\n _CurrentSpeed = _SprintSpeed;\n else\n _CurrentSpeed = _Speed;\n\n float xas = Input.GetAxis(\"Horizontal\");\n float zas = Input.GetAxis(\"Vertical\");\n\n transform.Translate(new Vector3(xas,0, zas) * _CurrentSpeed * Time.deltaTime);\n\n float mousex = Input.GetAxis(\"Mouse X\");\n float mousey = Input.GetAxis(\"Mouse Y\");\n transform.eulerAngles += new Vector3(-mousey, mousex, 0);\n }\n}\n"),
new Tool_QuickStart_Script("Movement_RB_FirstPerson", "Movement_3D", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[RequireComponent(typeof(Rigidbody))]\npublic class Movement_RB_FirstPerson : MonoBehaviour\n{\n [Header(\"Set Refference\")]\n [SerializeField] private Transform _Head = null;\n\n [Header(\"Settings\")]\n [SerializeField] private float _MovementSpeed = 5;\n [SerializeField] private float _JumpSpeed = 5;\n [SerializeField] private float _CameraSensitivity = 1;\n\n private Vector2 _LookRot = new Vector2(90,0);\n private Rigidbody _RB;\n private bool _Grounded;\n\n void Start()\n {\n Cursor.lockState = CursorLockMode.Locked;\n Cursor.visible = false;\n\n _RB = GetComponent<Rigidbody>();\n }\n\n void Update()\n {\n //Check Grounded\n _Grounded = Physics.CheckSphere(new Vector3(transform.position.x, transform.position.y - 1, transform.position.z), 0.4f);\n\n //Movement\n float x = Input.GetAxisRaw(\"Horizontal\") * _MovementSpeed;\n float y = Input.GetAxisRaw(\"Vertical\") * _MovementSpeed;\n\n //Jump\n if (Input.GetKeyDown(KeyCode.Space) && _Grounded)\n _RB.velocity = new Vector3(_RB.velocity.x, _JumpSpeed, _RB.velocity.z);\n\n //Apply Movement\n Vector3 move = transform.right * x + transform.forward * y;\n _RB.velocity = new Vector3(move.x, _RB.velocity.y, move.z);\n\n //Look around\n _LookRot.x += Input.GetAxis(\"Mouse X\") * _CameraSensitivity;\n _LookRot.y += Input.GetAxis(\"Mouse Y\") * _CameraSensitivity;\n _LookRot.y = Mathf.Clamp(_LookRot.y, -90, 90);\n\n transform.localRotation = Quaternion.AngleAxis(_LookRot.x, Vector3.up);\n _Head.transform.localRotation = Quaternion.AngleAxis(_LookRot.y, Vector3.left);\n }\n}\n"),
new Tool_QuickStart_Script("ObjectPool", "ObjectPool", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class ObjectPool : MonoBehaviour\n{\n [SerializeField] private ObjectPool_Pool[] _ObjectPools = null;\n private List<Transform> _Parents = new List<Transform>();\n\n public static ObjectPool POOL;\n\n private void Awake()\n {\n POOL = this;\n\n for (int i = 0; i < _ObjectPools.Length; i++)\n {\n //Create parent\n GameObject poolparent = new GameObject();\n Destroy(poolparent.GetComponent<MeshRenderer>());\n Destroy(poolparent.GetComponent<BoxCollider>());\n\n //Set parent\n poolparent.transform.parent = transform;\n poolparent.transform.name = \"Pool_\" + _ObjectPools[i]._Name;\n _Parents.Add(poolparent.transform);\n\n //Create objects\n for (int o = 0; o < _ObjectPools[i]._Amount; o++)\n {\n GameObject obj = (GameObject)Instantiate(_ObjectPools[i]._Prefab);\n obj.transform.parent = poolparent.transform;\n obj.transform.position = new Vector2(9999, 9999);\n obj.SetActive(false);\n _ObjectPools[i]._Objects.Add(obj);\n }\n }\n }\n\n //GetObject\n public GameObject GetObject(string objname)\n {\n int id = FindObjectPoolID(objname, false);\n return GetObject(id, true);\n }\n public GameObject GetObject(GameObject obj)\n {\n int id = FindObjectPoolID(obj);\n return GetObject(id, true);\n }\n public GameObject GetObjectPrefabName(string prefabname)\n {\n int id = FindObjectPoolID(prefabname, true);\n return GetObject(id, true);\n }\n\n //GetObject/setactive\n public GameObject GetObject(string objname, bool setactive)\n {\n int id = FindObjectPoolID(objname, false);\n return GetObject(id, setactive);\n }\n public GameObject GetObject(GameObject obj, bool setactive)\n {\n int id = FindObjectPoolID(obj);\n return GetObject(id, setactive);\n }\n public GameObject GetObjectPrefabName(string prefabname, bool setactive)\n {\n int id = FindObjectPoolID(prefabname, true);\n return GetObject(id, setactive);\n }\n\n public GameObject GetObject(int id, bool setactive)\n {\n GameObject freeObject = null;\n\n for (int i = 0; i < _ObjectPools[id]._Objects.Count; i++)\n {\n if (!_ObjectPools[id]._Objects[i].activeInHierarchy)\n {\n _ObjectPools[id]._Objects[i].transform.position = new Vector3(999, 999, 999);\n _ObjectPools[id]._Objects[i].SetActive(setactive);\n freeObject = _ObjectPools[id]._Objects[i];\n return freeObject;\n }\n }\n\n freeObject = (GameObject)Instantiate(_ObjectPools[id]._Prefab, new Vector3(999, 999, 999), Quaternion.identity);\n freeObject.transform.parent = _Parents[id];\n freeObject.SetActive(setactive);\n _ObjectPools[id]._Objects.Add(freeObject);\n return freeObject;\n }\n\n public List<GameObject> GetAllObjects(GameObject objtype)\n {\n int id = FindObjectPoolID(objtype);\n return _ObjectPools[id]._Objects;\n }\n\n private int FindObjectPoolID(GameObject obj)\n {\n int id = 0;\n for (int i = 0; i < _ObjectPools.Length; i++)\n {\n if (obj == _ObjectPools[i]._Prefab)\n {\n id = i;\n }\n }\n return id;\n }\n private int FindObjectPoolID(string objname, bool isprefab)\n {\n for (int i = 0; i < _ObjectPools.Length; i++)\n {\n if (isprefab)\n {\n if (objname == _ObjectPools[i]._Prefab.name)\n return i;\n }\n else if (objname == _ObjectPools[i]._Name)\n return i;\n }\n Debug.Log(objname + \" Not Found\");\n return 0;\n }\n}\n\n[System.Serializable]\npublic class ObjectPool_Pool\n{\n public string _Name;\n public GameObject _Prefab;\n public int _Amount;\n [HideInInspector] public List<GameObject> _Objects;\n}\n"),
new Tool_QuickStart_Script("ObjectPoolSimple", "ObjectPool", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class ObjectPoolSimple : MonoBehaviour\n{\n public GameObject prefabGameObject;\n public int pooledAmount;\n\n [HideInInspector] public List<GameObject> objects;\n\n void Awake()\n {\n for (int i = 0; i < pooledAmount; i++)\n {\n GameObject obj = (GameObject)Instantiate(prefabGameObject);\n obj.transform.parent = gameObject.transform;\n obj.SetActive(false);\n objects.Add(obj);\n }\n }\n}\n\n\n/* Use Pool\n \n [SerializeField]private ObjectPoolSimple _ObjectPool;\n\n private void Spawn() {\n for (int i = 0; i < _ObjectPool.objects.Count; i++) {\n if (!_ObjectPool.objects[i].activeInHierarchy) {\n _ObjectPool.objects[i].transform.position = new Vector3(0,0,0);\n _ObjectPool.objects[i].transform.rotation = Quaternion.Euler(0, 0, 0);\n _ObjectPool.objects[i].SetActive(true);\n break;\n }\n }\n }\n*/\n"),
new Tool_QuickStart_Script("OnCollision", "Collision_Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.Events;\n\npublic class OnCollision : MonoBehaviour\n{\n private enum Options { OnTriggerEnter, OnTriggerExit, OnTriggerStay, OnCollisionEnter, OnCollisionExit, OnCollisionStay, OnAll };\n [SerializeField] private LayerMask _LayerMask = ~0;\n [SerializeField] private Options _Option = Options.OnAll;\n [SerializeField] private string _Tag = \"\";\n [SerializeField] private UnityEvent _Event = null;\n\n private bool _HasTag;\n\n private void Start()\n {\n if (_Tag != \"\" && _Tag != null)\n _HasTag = true;\n }\n\n private void Action(Collider other)\n {\n if (_HasTag)\n {\n if (other.CompareTag(_Tag) && _LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n else\n if(_LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n private void Action(Collision other)\n {\n if (_HasTag)\n { \n if (other.gameObject.CompareTag(_Tag) && _LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n else\n if (_LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n\n private void OnTriggerEnter(Collider other)\n {\n if (_Option == Options.OnTriggerEnter || _Option == Options.OnAll)\n Action(other);\n }\n private void OnTriggerExit(Collider other)\n {\n if (_Option == Options.OnTriggerExit || _Option == Options.OnAll)\n Action(other);\n }\n private void OnTriggerStay(Collider other)\n {\n if (_Option == Options.OnTriggerStay || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionEnter(Collision other)\n {\n if (_Option == Options.OnCollisionEnter || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionExit(Collision other)\n {\n if (_Option == Options.OnCollisionExit || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionStay(Collision other)\n {\n if (_Option == Options.OnCollisionStay || _Option == Options.OnAll)\n Action(other);\n }\n}\n"),
new Tool_QuickStart_Script("OnCollision2D", "Collision_2D_Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.Events;\n\npublic class OnCollision2D : MonoBehaviour\n{\n private enum Options {OnTriggerEnter, OnTriggerExit, OnTriggerStay, OnCollisionEnter, OnCollisionExit, OnCollisionStay, OnAll};\n [SerializeField] private LayerMask _LayerMask = ~0;\n [SerializeField] private Options _Option = Options.OnAll;\n [SerializeField] private string _Tag = \"\";\n [SerializeField] private UnityEvent _Event = null;\n\n private bool _HasTag;\n\n private void Start()\n {\n if (_Tag != \"\" && _Tag != null)\n _HasTag = true;\n }\n\n private void Action(Collider2D other)\n {\n if (_HasTag)\n {\n if (other.CompareTag(_Tag) && _LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n else\n if(_LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n private void Action(Collision2D other)\n {\n if (_HasTag)\n { \n if (other.gameObject.CompareTag(_Tag) && _LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n else\n if (_LayerMask == (_LayerMask | (1 << other.gameObject.layer)))\n _Event.Invoke();\n }\n\n private void OnTriggerEnter2D(Collider2D other)\n {\n if (_Option == Options.OnTriggerEnter || _Option == Options.OnAll)\n Action(other);\n }\n private void OnTriggerExit2D(Collider2D other)\n {\n if (_Option == Options.OnTriggerExit || _Option == Options.OnAll)\n Action(other);\n }\n private void OnTriggerStay2D(Collider2D other)\n {\n if (_Option == Options.OnTriggerStay || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionEnter2D(Collision2D other)\n {\n if (_Option == Options.OnCollisionEnter || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionExit2D(Collision2D other)\n {\n if (_Option == Options.OnCollisionExit || _Option == Options.OnAll)\n Action(other);\n }\n private void OnCollisionStay2D(Collision2D other)\n {\n if (_Option == Options.OnCollisionStay || _Option == Options.OnAll)\n Action(other);\n }\n}\n"),
new Tool_QuickStart_Script("PauseMenu", "Menu_Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class PauseMenu : MonoBehaviour\n{\n [SerializeField] private GameObject _PauseMenu;\n\n void Update()\n {\n if(Input.GetKeyDown(KeyCode.Escape))\n {\n _PauseMenu.SetActive(!_PauseMenu.activeSelf);\n\n if (_PauseMenu.activeSelf)\n Time.timeScale = 0;\n else\n Time.timeScale = 1;\n }\n }\n\n public void LoadScene(int sceneid)\n {\n SceneManager.LoadScene(sceneid);\n Time.timeScale = 1;\n }\n\n public void LoadScene(string scenename)\n {\n SceneManager.LoadScene(scenename);\n Time.timeScale = 1;\n }\n\n public void Resume()\n {\n _PauseMenu.SetActive(false);\n Time.timeScale = 1;\n }\n}\n"),
new Tool_QuickStart_Script("Pendulum", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Pendulum : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _Speed = 1;\n [SerializeField] private float _Distance = 20;\n\n [Header(\"Offset\")]\n [SerializeField] private Vector3 _RotationOffset = Vector3.zero;\n [SerializeField] private bool _SetCurrentRotationAsOffset = true;\n\n enum AxisOptions { X, Y, Z }\n [SerializeField] private AxisOptions _Axis = AxisOptions.X;\n\n private void Start()\n {\n if (_SetCurrentRotationAsOffset)\n _RotationOffset = transform.eulerAngles;\n }\n\n void Update()\n {\n float angle = _Distance * Mathf.Sin(Time.time * _Speed);\n switch (_Axis)\n {\n case AxisOptions.X:\n transform.localRotation = Quaternion.Euler(_RotationOffset.x + angle, _RotationOffset.y, _RotationOffset.z);\n break;\n case AxisOptions.Y:\n transform.localRotation = Quaternion.Euler(_RotationOffset.x, _RotationOffset.y + angle, _RotationOffset.z);\n break;\n case AxisOptions.Z:\n transform.localRotation = Quaternion.Euler(_RotationOffset.x, _RotationOffset.y, _RotationOffset.z + angle);\n break;\n }\n }\n}\n"),
new Tool_QuickStart_Script("PosToPos", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class PosToPos : MonoBehaviour\n{\n [Header(\"Target Position\")]\n [SerializeField] private Transform _GotoPosition = null;\n\n [Header(\"Settings\")]\n [SerializeField] private float _Speed = 1;\n [SerializeField] private bool _Lerp = false;\n [SerializeField] private bool _OnStart = false;\n\n private bool _Activated;\n\n private void Start()\n {\n if (_OnStart)\n StartMoving();\n }\n\n void Update()\n {\n if (_Activated)\n if (_Lerp)\n transform.position = Vector3.Lerp(transform.position, _GotoPosition.position, _Speed * Time.deltaTime);\n else\n transform.position = Vector3.MoveTowards(transform.position, _GotoPosition.position, _Speed * Time.deltaTime);\n }\n\n public void StartMoving()\n {\n _Activated = true;\n }\n}\n"),
new Tool_QuickStart_Script("RandomEvent", "practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine.Events;\nusing UnityEngine;\n\npublic class RandomEvent : MonoBehaviour\n{\n [SerializeField] private Vector2 _RandomMinMax;\n [SerializeField] private UnityEvent _Event;\n\n private float _Timer;\n private float _NextGoal;\n\n void Start()\n {\n _NextGoal = Random.Range(_RandomMinMax.x, _RandomMinMax.y);\n }\n\n void Update()\n {\n _Timer += 1 * Time.deltaTime;\n if (_Timer >= _NextGoal)\n {\n _Event.Invoke();\n _Timer = 0;\n _NextGoal = _NextGoal = Random.Range(_RandomMinMax.x, _RandomMinMax.y);\n }\n }\n\n public void AudioHandlerEvent(string audiotrack)\n {\n AudioHandler.AUDIO.PlayTrack(audiotrack);\n }\n}\n"),
new Tool_QuickStart_Script("ReadAudioFile", "Read_File_Audio", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class ReadAudioFile : MonoBehaviour\n{\n [Header(\"Settings\")]\n private AudioSource _AudioScource = null;\n private bool _PlayOnStart = true;\n\n [Header(\"Info\")]\n public float[] Samples = new float[512];\n public float[] FreqBand = new float[8];\n public float[] BandBuffer = new float[8];\n public float[] BufferDecrease = new float[8];\n\n void Start()\n {\n if (_AudioScource == null)\n _AudioScource = GetComponent<AudioSource>();\n\n if (_PlayOnStart)\n _AudioScource.Play();\n }\n\n void Update()\n {\n GetSpectrumAudioSource();\n MakeFrequencyBands();\n UpdateBandBuffer();\n }\n\n void GetSpectrumAudioSource()\n {\n _AudioScource.GetSpectrumData(Samples, 0, FFTWindow.Blackman);\n }\n\n void UpdateBandBuffer()\n {\n for (int i = 0; i < 8; i++)\n {\n if (FreqBand[i] > BandBuffer[i])\n {\n BandBuffer[i] = FreqBand[i];\n BufferDecrease[i] = 0.005f;\n }\n if (FreqBand[i] < BandBuffer[i])\n {\n BandBuffer[i] -= BufferDecrease[i];\n BufferDecrease[i] *= 1.2f;\n }\n }\n }\n\n void MakeFrequencyBands()\n {\n float average = 0;\n int count = 0;\n\n for (int i = 0; i < 8; i++)\n {\n int sampleCount = (int)Mathf.Pow(2, i) * 2;\n\n if (i == 7)\n sampleCount += 2;\n\n for (int j = 0; j < sampleCount; j++)\n {\n average += Samples[count] * (count + 1);\n count++;\n }\n\n average /= count;\n FreqBand[i] = average * 10;\n }\n }\n}\n"),
new Tool_QuickStart_Script("ReadTwitchChat", "Networking", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing System;\nusing System.ComponentModel;\nusing System.Net.Sockets;\nusing System.IO;\n\npublic class ReadTwitchChat : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _RefreshConnectionTimer = 60;\n private float _Timer;\n\n [Header(\"Twitch\")]\n private TcpClient twitchClient;\n private StreamReader reader;\n private StreamWriter writer;\n\n [SerializeField] private string _Username = \"\"; //Twitch user name\n [SerializeField] private string _OauthToken = \"\"; //Get token from https://twitchapps.com/tmi\n [SerializeField] private string _Channelname = \"\"; //Twitch channel name\n\n void Start()\n {\n Connect();\n }\n\n void Update()\n {\n //Check connection\n if (!twitchClient.Connected)\n Connect();\n\n _Timer -= 1 * Time.deltaTime;\n if (_Timer <= 0)\n {\n Connect();\n _Timer = _RefreshConnectionTimer;\n }\n\n ReadChat();\n }\n\n private void Connect()\n {\n twitchClient = new TcpClient(\"irc.chat.twitch.tv\", 6667);\n reader = new StreamReader(twitchClient.GetStream());\n writer = new StreamWriter(twitchClient.GetStream());\n\n writer.WriteLine(\"PASS \" + _OauthToken);\n writer.WriteLine(\"NICK \" + _Username);\n writer.WriteLine(\"USER \" + _Username + \" 8 * :\" + _Username);\n writer.WriteLine(\"JOIN #\" + _Channelname);\n\n writer.Flush();\n }\n\n private void ReadChat()\n {\n if (twitchClient.Available > 0)\n {\n var message = reader.ReadLine();\n\n if (message.Contains(\"PRIVMSG\"))\n {\n //Split\n var splitPoint = message.IndexOf(\"!\", 1);\n var chatName = message.Substring(0, splitPoint);\n\n //Name\n chatName = chatName.Substring(1);\n\n //Message\n splitPoint = message.IndexOf(\":\", 1);\n message = message.Substring(splitPoint + 1);\n print(string.Format(\"{0}: {1}\", chatName, message));\n\n if (message.ToLower().Contains(\"example\"))\n {\n Debug.Log(\"<color=green>\" + chatName + \" has used the command example </color>\");\n }\n }\n }\n }\n\n}\n"),
new Tool_QuickStart_Script("ReadWrite_TextFile", "Read_Write_File", "stable", "", "using UnityEngine;\nusing System.IO;\n\npublic class ReadWrite_TextFile : MonoBehaviour\n{\n [SerializeField] private string _Path = \"\";\n [SerializeField] private string _FileName = \"ExampleTextFile\";\n\n [Header(\"Example\")]\n [SerializeField] private string _Message = \"Test Message\";\n\n void Start()\n {\n if (_Path == \"\")\n {\n _Path = \"Assets/\" + _FileName;\n }\n\n WriteTextFile();\n ReadTextFile();\n }\n\n public void ReadTextFile()\n {\n StreamReader reader = new StreamReader(_Path + \".txt\");\n Debug.Log(\"Read Result: \" + reader.ReadToEnd());\n reader.Close();\n }\n\n public void WriteTextFile()\n {\n StreamWriter writer = new StreamWriter(_Path + \".txt\", true);\n writer.WriteLine(_Message);\n writer.Close();\n Debug.Log(\"Write Complete\");\n }\n}\n"),
new Tool_QuickStart_Script("RestartOnKey", "Practical", "stable", "", "using UnityEngine.SceneManagement;\nusing UnityEngine;\n\npublic class RestartOnKey : MonoBehaviour\n{\n [SerializeField] private KeyCode _Key = KeyCode.R;\n\n void Update()\n {\n if(Input.GetKeyDown(_Key))\n SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);\n }\n}\n"),
new Tool_QuickStart_Script("Rotation", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Rotation : MonoBehaviour\n{\n [SerializeField] private Vector3 _RotationSpeed = Vector3.zero;\n\n void Update()\n {\n transform.Rotate(new Vector3(_RotationSpeed.x, _RotationSpeed.y, _RotationSpeed.z) * Time.deltaTime);\n }\n}\n"),
new Tool_QuickStart_Script("RotToRot", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class RotToRot : MonoBehaviour\n{\n [SerializeField] private Vector3 _TargetAngle = new Vector3(0f, 0f, 0f);\n\n [Header(\"Settings\")]\n [SerializeField] private float _Speed = 1;\n [SerializeField] private bool _Lerp = true;\n [SerializeField] private bool _OnStart = false;\n\n private bool _Activated;\n\n private Vector3 _CurrentAngle;\n\n void Start()\n {\n _CurrentAngle = transform.localEulerAngles;\n\n if(_OnStart)\n StartRotating();\n }\n\n void Update()\n {\n if (_Activated)\n {\n if (_Lerp)\n {\n _CurrentAngle = new Vector3(\n Mathf.LerpAngle(_CurrentAngle.x, _TargetAngle.x, _Speed * Time.deltaTime),\n Mathf.LerpAngle(_CurrentAngle.y, _TargetAngle.y, _Speed * Time.deltaTime),\n Mathf.LerpAngle(_CurrentAngle.z, _TargetAngle.z, _Speed * Time.deltaTime));\n }\n else\n {\n _CurrentAngle = Vector3.MoveTowards(_CurrentAngle, _TargetAngle, _Speed * Time.deltaTime);\n }\n transform.localEulerAngles = _CurrentAngle;\n }\n }\n\n public void StartRotating()\n {\n _Activated = true;\n }\n}\n"),
new Tool_QuickStart_Script("SaveLoad_JSON", "Json_Save_Load", "stable", "", "using System.Collections.Generic;\nusing System.IO;\nusing UnityEngine;\n\npublic class SaveLoad_JSON : MonoBehaviour\n{\n private Json_SaveData _SaveData = new Json_SaveData();\n\n void Start()\n {\n LoadData();\n }\n\n public void SaveData()\n {\n string jsonData = JsonUtility.ToJson(_SaveData, true);\n File.WriteAllText(Application.persistentDataPath + \"/SaveData.json\", jsonData);\n }\n public void LoadData()\n {\n try\n {\n string dataAsJson = File.ReadAllText(Application.persistentDataPath + \"/SaveData.json\");\n _SaveData = JsonUtility.FromJson<Json_SaveData>(dataAsJson);\n }\n catch\n {\n SaveData();\n }\n }\n public Json_SaveData GetSaveData()\n {\n return _SaveData;\n }\n public void CreateNewSave()\n {\n Json_ExampleData newsave = new Json_ExampleData();\n newsave.exampleValue = 10;\n _SaveData.saveData.Add(newsave);\n }\n}\n\n[System.Serializable]\npublic class Json_SaveData\n{\n public List <Json_ExampleData> saveData = new List<Json_ExampleData>();\n}\n[System.Serializable]\npublic class Json_ExampleData\n{\n public float exampleValue = 0;\n}\n"),
new Tool_QuickStart_Script("SaveLoad_XML", "XML_Save_Load", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing System.Xml.Serialization;\nusing System.IO;\n\npublic class SaveLoad_XML : MonoBehaviour\n{\n private XML_SaveData _SaveData = new XML_SaveData();\n\n void Start()\n {\n LoadData();\n }\n\n public void SaveData()\n {\n XmlSerializer serializer = new XmlSerializer(typeof(XML_SaveData));\n\n using (FileStream stream = new FileStream(Application.persistentDataPath + \"/SaveData.xml\", FileMode.Create))\n {\n serializer.Serialize(stream, _SaveData);\n }\n }\n\n public void LoadData()\n {\n try\n {\n XmlSerializer serializer = new XmlSerializer(typeof(XML_SaveData));\n\n using (FileStream stream = new FileStream(Application.persistentDataPath + \"/SaveData.xml\", FileMode.Open))\n {\n _SaveData = serializer.Deserialize(stream) as XML_SaveData;\n }\n }\n catch\n {\n SaveData();\n }\n }\n\n public XML_SaveData GetSaveData()\n {\n return _SaveData;\n }\n public void CreateNewSave()\n {\n XML_ExampleData newsave = new XML_ExampleData();\n newsave.exampleValue = 10;\n _SaveData.saveData.Add(newsave);\n }\n}\n\n[System.Serializable]\npublic class XML_SaveData\n{\n public List<XML_ExampleData> saveData = new List<XML_ExampleData>();\n}\n[System.Serializable]\npublic class XML_ExampleData\n{\n public float exampleValue = 0;\n}\n"),
new Tool_QuickStart_Script("ScaleOnDistance", "Practical", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class ScaleOnDistance : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private bool _Revert;\n [SerializeField] private Vector2 _MinMaxSize;\n [SerializeField] private Vector2 _MinMaxDistance;\n\n [Header(\"Target\")]\n [SerializeField] private Transform _Target;\n\n private Vector3 _DefaultScale;\n\n void Start()\n {\n _DefaultScale = transform.localScale;\n }\n\n void Update()\n {\n //Calc\n float a = (Vector3.Distance(transform.position, _Target.position) - _MinMaxDistance.x) * (1 / (_MinMaxDistance.y - _MinMaxDistance.x));\n float b = _MinMaxSize.y - _MinMaxSize.x;\n\n if (_Revert)\n a = 1 - a;\n\n float newsize = a * b;\n\n //Limits\n if (newsize < _MinMaxSize.x)\n newsize = _MinMaxSize.x;\n if (newsize > _MinMaxSize.y)\n newsize = _MinMaxSize.y;\n\n //Apply\n transform.localScale = _DefaultScale * newsize;\n }\n}\n"),
new Tool_QuickStart_Script("ScriptebleGameObject", "SO_ScriptebleGameObject", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n[CreateAssetMenu(fileName = \"Example\", menuName = \"SO/ExampleSO\", order = 1)]\npublic class ScriptebleGameObject : ScriptableObject\n{\n public string examplestring;\n public int exampleint;\n}\n"),
new Tool_QuickStart_Script("SettingsHandler", "Settings_Handler", "wip", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing TMPro;\nusing UnityEngine.Audio;\nusing UnityEngine.UI;\nusing System;\n\npublic class SettingsHandler : MonoBehaviour\n{\n [Header(\"Audio\")]\n [SerializeField] private AudioMixer _AudioMixer = null;\n [SerializeField] private float _Current_Volume = 1;\n [SerializeField] private Slider _Slider_Volume = null;\n\n [Header(\"Screen\")]\n [SerializeField] private TMP_Dropdown _Dropdown_Resolution = null;\n [SerializeField] private TMP_Dropdown _DropDown_ScreenOptions = null;\n\n [Header(\"Quality\")]\n [SerializeField] private TMP_Dropdown _Dropdown_Quality = null;\n [SerializeField] private TMP_Dropdown _Dropdown_Texture = null;\n [SerializeField] private TMP_Dropdown _Dropdown_AA = null;\n\n [SerializeField] private Resolution[] _Resolutions = null;\n\n [Header(\"Extra\")]\n [SerializeField] private Toggle _Toggle_Vsync = null;\n [SerializeField] private TextMeshProUGUI _Text_FPS;\n\n private void Start()\n {\n _Resolutions = Screen.resolutions;\n\n //Resolutions\n if (_Dropdown_Resolution != null)\n {\n _Dropdown_Resolution.ClearOptions();\n List<string> options = new List<string>();\n int currentresid = 0;\n for (int i = 0; i < _Resolutions.Length; i++)\n {\n string option = _Resolutions[i].width + \" x \" + _Resolutions[i].height;\n options.Add(option);\n\n if (_Resolutions[i].width == Screen.currentResolution.width && _Resolutions[i].height == Screen.currentResolution.height)\n currentresid = i;\n }\n\n _Dropdown_Resolution.AddOptions(options);\n _Dropdown_Resolution.value = currentresid;\n _Dropdown_Resolution.RefreshShownValue();\n }\n\n //Screen\n if (_DropDown_ScreenOptions != null)\n {\n _DropDown_ScreenOptions.ClearOptions();\n List<string> options = new List<string>();\n options.Add(\"Fullscreen\");\n options.Add(\"Windowed\");\n options.Add(\"Borderless Window\");\n _DropDown_ScreenOptions.AddOptions(options);\n }\n\n //Quallity\n if (_Dropdown_Quality != null)\n {\n _Dropdown_Quality.ClearOptions();\n List<string> options = new List<string>();\n options.Add(\"Very Low\");\n options.Add(\"Low\");\n options.Add(\"Medium\");\n options.Add(\"High\");\n options.Add(\"Very High\");\n options.Add(\"Ultra\");\n _Dropdown_Quality.AddOptions(options);\n }\n }\n\n private void Update()\n {\n if (_Text_FPS != null)\n _Text_FPS.text = \"Current FPS: \" + Mathf.RoundToInt((1 / Time.unscaledDeltaTime)).ToString(\"0\");\n }\n\n // [Display]\n //Resolution\n public void Set_Resolution(int resid)\n {\n Resolution resolution = _Resolutions[resid];\n Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);\n }\n\n //FullScreen\n public void Set_FullScreen(bool isFullscreen)\n {\n Screen.fullScreen = isFullscreen;\n }\n\n //Quiality\n public void Set_Quality(int qualityid)\n {\n if (qualityid != 6) // Default\n\n QualitySettings.SetQualityLevel(qualityid);\n switch (qualityid)\n {\n case 0: // quality level - very low\n _Dropdown_Texture.value = 3;\n _Dropdown_AA.value = 0;\n break;\n case 1: // quality level - low\n _Dropdown_Texture.value = 2;\n _Dropdown_AA.value = 0;\n break;\n case 2: // quality level - medium\n _Dropdown_Texture.value = 1;\n _Dropdown_AA.value = 0;\n break;\n case 3: // quality level - high\n _Dropdown_Texture.value = 0;\n _Dropdown_AA.value = 0;\n break;\n case 4: // quality level - very high\n _Dropdown_Texture.value = 0;\n _Dropdown_AA.value = 1;\n break;\n case 5: // quality level - ultra\n _Dropdown_Texture.value = 0;\n _Dropdown_AA.value = 2;\n break;\n }\n\n _Dropdown_Quality.value = qualityid;\n }\n\n //Vsync\n //MaxFOS\n //Gama\n\n // [Grapics]\n //Antialiasing\n public void SetAntiAliasing(int aaid)\n {\n QualitySettings.antiAliasing = aaid;\n _Dropdown_Quality.value = 6;\n }\n\n //Shadows\n //ViewDistance\n //TextureQuality\n public void Set_TextureQuality(int textureid)\n {\n QualitySettings.masterTextureLimit = textureid;\n _Dropdown_Quality.value = 6;\n }\n\n //ViolageDistance\n //ViolageDensity\n\n // [Gameplay]\n //SoundAll\n public void Set_Volume(float volume)\n {\n _AudioMixer.SetFloat(\"Volume\", volume);\n _Current_Volume = volume;\n }\n\n //SoundEffects\n //Music\n\n // Quit / Save / Load\n public void ExitGame()\n {\n Application.Quit();\n }\n public void SaveSettings()\n {\n if (_Dropdown_Quality != null)\n PlayerPrefs.SetInt(\"QualitySettingPreference\", _Dropdown_Quality.value);\n\n if (_Dropdown_Resolution != null)\n PlayerPrefs.SetInt(\"ResolutionPreference\", _Dropdown_Resolution.value);\n\n if (_Dropdown_Texture != null)\n PlayerPrefs.SetInt(\"TextureQualityPreference\", _Dropdown_Texture.value);\n\n if (_Dropdown_AA != null)\n PlayerPrefs.SetInt(\"AntiAliasingPreference\", _Dropdown_AA.value);\n\n if (_DropDown_ScreenOptions != null)\n {\n if (_DropDown_ScreenOptions.value == 0)\n PlayerPrefs.SetInt(\"FullscreenPreference\", Convert.ToInt32(Screen.fullScreen));\n if (_DropDown_ScreenOptions.value == 1)\n PlayerPrefs.SetInt(\"FullscreenPreference\", Convert.ToInt32(Screen.fullScreenMode = FullScreenMode.Windowed));\n if (_DropDown_ScreenOptions.value == 2)\n PlayerPrefs.SetInt(\"FullscreenPreference\", Convert.ToInt32(Screen.fullScreenMode = FullScreenMode.FullScreenWindow));\n }\n\n if (_Toggle_Vsync != null)\n if (_Toggle_Vsync.isOn)\n Application.targetFrameRate = 60;\n else\n Application.targetFrameRate = 999;\n\n PlayerPrefs.SetFloat(\"VolumePreference\", _Current_Volume);\n }\n public void LoadSettings(int currentResolutionIndex)\n {\n if (PlayerPrefs.HasKey(\"QualitySettingPreference\"))\n _Dropdown_Quality.value =\n PlayerPrefs.GetInt(\"QualitySettingPreference\");\n else\n _Dropdown_Quality.value = 3;\n if (PlayerPrefs.HasKey(\"ResolutionPreference\"))\n _Dropdown_Resolution.value =\n PlayerPrefs.GetInt(\"ResolutionPreference\");\n else\n _Dropdown_Resolution.value = currentResolutionIndex;\n if (PlayerPrefs.HasKey(\"TextureQualityPreference\"))\n _Dropdown_Texture.value =\n PlayerPrefs.GetInt(\"TextureQualityPreference\");\n else\n _Dropdown_Texture.value = 0;\n if (PlayerPrefs.HasKey(\"AntiAliasingPreference\"))\n _Dropdown_AA.value =\n PlayerPrefs.GetInt(\"AntiAliasingPreference\");\n else\n _Dropdown_AA.value = 1;\n if (PlayerPrefs.HasKey(\"FullscreenPreference\"))\n Screen.fullScreen =\n Convert.ToBoolean(PlayerPrefs.GetInt(\"FullscreenPreference\"));\n else\n Screen.fullScreen = true;\n if (PlayerPrefs.HasKey(\"VolumePreference\"))\n _Slider_Volume.value =\n PlayerPrefs.GetFloat(\"VolumePreference\");\n else\n _Slider_Volume.value =\n PlayerPrefs.GetFloat(\"VolumePreference\");\n }\n\n\n //Set\n public void SetDropDown_Resolution(TMP_Dropdown resolutions)\n {\n _Dropdown_Resolution = resolutions;\n }\n public void SetDropDown_Quality(TMP_Dropdown quality)\n {\n _Dropdown_Quality = quality;\n }\n public void SetDropDown_TextureQuality(TMP_Dropdown texturequality)\n {\n _Dropdown_Texture = texturequality;\n }\n public void SetDropDown_AA(TMP_Dropdown aa)\n {\n _Dropdown_AA = aa;\n }\n public void SetSlider_VolumeSlider(Slider volumeslider)\n {\n _Slider_Volume = volumeslider;\n }\n}\n"),
new Tool_QuickStart_Script("Shooting", "Shooting", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Shooting : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] ObjectPool _ObjectPool = null;\n [SerializeField] private GameObject _BulletPrefab = null;\n [SerializeField] private GameObject _ShootPoint = null;\n\n [Header(\"Semi\")]\n [SerializeField] private int _SemiAutomaticBulletAmount = 3;\n [SerializeField] private float _SemiShootSpeed = 0.2f;\n [Header(\"Automatic\")]\n [SerializeField] private float _SecondsBetweenShots = 0.5f;\n\n private enum ShootModes { SingleShot, SemiAutomatic, Automatic }\n [SerializeField] private ShootModes _ShootMode = ShootModes.SingleShot;\n\n private bool _CheckSingleShot;\n private float _Timer;\n private bool _LockShooting;\n\n void Update()\n {\n if (Input.GetMouseButton(0))\n {\n switch (_ShootMode)\n {\n case ShootModes.SingleShot:\n if (!_CheckSingleShot)\n Shoot();\n _CheckSingleShot = true;\n break;\n case ShootModes.SemiAutomatic:\n if (!_CheckSingleShot && !_LockShooting)\n StartCoroutine(SemiShot());\n _CheckSingleShot = true;\n break;\n case ShootModes.Automatic:\n _Timer += 1 * Time.deltaTime;\n if (_Timer >= _SecondsBetweenShots)\n {\n Shoot();\n _Timer = 0;\n }\n break;\n }\n }\n if (Input.GetMouseButtonUp(0))\n {\n _CheckSingleShot = false;\n }\n }\n\n IEnumerator SemiShot()\n {\n _LockShooting = true;\n for (int i = 0; i < _SemiAutomaticBulletAmount; i++)\n {\n Shoot();\n yield return new WaitForSeconds(_SemiShootSpeed);\n }\n _LockShooting = false;\n }\n\n void Shoot()\n {\n GameObject bullet = _ObjectPool.GetObject(_BulletPrefab, true);\n bullet.SetActive(true);\n bullet.transform.position = _ShootPoint.transform.position;\n bullet.transform.rotation = _ShootPoint.transform.rotation;\n }\n}\n"),
new Tool_QuickStart_Script("ShootingRayCast", "Shooting", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing System.Threading;\nusing UnityEngine;\n\npublic class ShootingRayCast : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private float _Damage = 20;\n [SerializeField] private float _ShootDistance = 50;\n [SerializeField] private string _EnemyTag = \"Enemy\";\n\n [Header(\"Semi\")]\n [SerializeField] private int _SemiAutomaticBulletAmount = 3;\n [SerializeField] private float _SemiShootSpeed = 0.2f;\n [Header(\"Automatic\")]\n [SerializeField] private float _SecondsBetweenShots = 0.5f;\n\n private enum ShootModes {SingleShot, SemiAutomatic, Automatic }\n [SerializeField] private ShootModes _ShootMode = ShootModes.SingleShot;\n\n private bool _CheckSingleShot;\n private float _Timer;\n private bool _LockShooting;\n\n void Update()\n {\n if (Input.GetMouseButton(0))\n {\n switch (_ShootMode)\n {\n case ShootModes.SingleShot:\n if (!_CheckSingleShot)\n Shoot();\n _CheckSingleShot = true;\n break;\n case ShootModes.SemiAutomatic:\n if (!_CheckSingleShot && !_LockShooting)\n StartCoroutine(SemiShot());\n _CheckSingleShot = true;\n break;\n case ShootModes.Automatic:\n _Timer += 1 * Time.deltaTime;\n if(_Timer >= _SecondsBetweenShots)\n {\n Shoot();\n _Timer = 0;\n }\n break;\n }\n }\n if(Input.GetMouseButtonUp(0))\n {\n _CheckSingleShot = false;\n }\n }\n\n IEnumerator SemiShot()\n {\n _LockShooting = true;\n for (int i = 0; i < _SemiAutomaticBulletAmount; i++)\n {\n Shoot();\n yield return new WaitForSeconds(_SemiShootSpeed);\n }\n _LockShooting = false;\n }\n\n void Shoot()\n {\n RaycastHit hit;\n if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, _ShootDistance))\n if (hit.transform.tag == _EnemyTag)\n {\n hit.transform.GetComponent<Health>().DoDamage(_Damage);\n }\n }\n}\n"),
new Tool_QuickStart_Script("StringFormats", "String_Format", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing TMPro;\n\npublic class StringFormats : MonoBehaviour\n{\n private enum FormatOptions {DigitalTime };\n [SerializeField] private FormatOptions _FormatOption = FormatOptions.DigitalTime;\n [SerializeField] private TextMeshProUGUI _ExampleText = null;\n\n private float _Timer;\n\n void Update()\n {\n _Timer += 1 * Time.deltaTime;\n\n switch (_FormatOption)\n {\n case FormatOptions.DigitalTime:\n _ExampleText.text = string.Format(\"{0:00}:{1:00}:{2:00}\", Mathf.Floor(_Timer / 3600), Mathf.Floor((_Timer / 60) % 60), _Timer % 60);\n break;\n }\n }\n}\n"),
new Tool_QuickStart_Script("Tool_CreateHexagonMesh", "Tool_Editor", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEditor;\n\npublic class Tool_CreateHexagonMesh : EditorWindow\n{\n private GameObject _CenterObj;\n private List<GameObject> _ObjSaved = new List<GameObject>();\n private int _TotalObjects = 100;\n\n //Hex\n private int _HexLengthX = 10, _HexLengthZ = 10;\n private float _HexSize = 1;\n private float _DistanceBetween = 1;\n\n private bool _Center = true;\n private bool _Invert = false;\n\n [MenuItem(\"Tools/CreateHexagonGrid\")]\n static void Init()\n {\n Tool_CreateHexagonMesh window = (Tool_CreateHexagonMesh)EditorWindow.GetWindow(typeof(Tool_CreateHexagonMesh));\n window.Show();\n }\n\n void OnGUI()\n { \n GUILayout.BeginVertical(\"Box\");\n _CenterObj = (GameObject)EditorGUILayout.ObjectField(\"Center Object\", _CenterObj, typeof(GameObject), true);\n GUILayout.EndVertical();\n\n GUILayout.BeginVertical(\"Box\");\n _HexSize = EditorGUILayout.FloatField(\"Size: \", _HexSize);\n _HexLengthX = EditorGUILayout.IntField(\"Collom: \", _HexLengthX);\n _HexLengthZ = EditorGUILayout.IntField(\"Row: \", _HexLengthZ);\n\n GUILayout.BeginHorizontal(\"Box\");\n if (GUILayout.Button(\"Calculate Total Objects\"))\n _TotalObjects = _HexLengthX * _HexLengthZ;\n EditorGUILayout.LabelField(\"Total: \" + _TotalObjects.ToString());\n GUILayout.EndHorizontal();\n\n _Center = EditorGUILayout.Toggle(\"Center\", _Center);\n _Invert = EditorGUILayout.Toggle(\"Invert: \", _Invert);\n _DistanceBetween = EditorGUILayout.FloatField(\"Distance Between: \", _DistanceBetween);\n GUILayout.EndVertical();\n\n GUILayout.BeginVertical(\"Box\");\n if (GUILayout.Button(\"Create\"))\n {\n if (_CenterObj != null)\n {\n if (_ObjSaved.Count > 0)\n {\n for (int i = 0; i < _ObjSaved.Count; i++)\n {\n DestroyImmediate(_ObjSaved[i]);\n }\n _ObjSaved.Clear();\n }\n\n Vector3 objPos = _CenterObj.transform.position;\n CreateHexagon(new Vector3(_HexLengthX, 0, _HexLengthZ));\n SetParent();\n }\n else\n {\n Debug.Log(\"Center Object not selected!\");\n }\n }\n\n if (GUILayout.Button(\"Destroy\"))\n {\n if (_CenterObj != null)\n {\n for (int i = 0; i < _ObjSaved.Count; i++)\n {\n DestroyImmediate(_ObjSaved[i]);\n }\n _ObjSaved.Clear();\n\n\n int childs = _CenterObj.transform.childCount;\n for (int i = childs -1; i >= 0; i--)\n {\n DestroyImmediate(_CenterObj.transform.GetChild(i).gameObject);\n }\n }\n else\n {\n Debug.Log(\"Center Object not selected!\");\n }\n }\n\n if (GUILayout.Button(\"Confirm\"))\n {\n _ObjSaved.Clear();\n }\n GUILayout.EndVertical();\n }\n\n void CreateHexagon(Vector3 dimentsions)\n {\n Vector3 objPos = _CenterObj.transform.position;\n if (_Center && !_Invert)\n {\n objPos.x -= dimentsions.x * 0.5f * 1.7321f * _HexSize;\n objPos.z -= dimentsions.z * 0.5f * -1.5f * _HexSize;\n }\n if (_Center && _Invert)\n {\n objPos.x -= dimentsions.x * 0.5f * 1.7321f * _HexSize;\n objPos.z += dimentsions.z * 0.5f * -1.5f * _HexSize;\n }\n\n for (int xas = 0; xas < dimentsions.x; xas++)\n {\n CreateHax(new Vector3(objPos.x + 1.7321f * _HexSize * _DistanceBetween * xas, objPos.y, objPos.z));\n for (int zas = 1; zas < dimentsions.z; zas++)\n {\n float offset = 0;\n if (zas % 2 == 1)\n {\n offset = 0.86605f * _HexSize * _DistanceBetween;\n }\n else\n {\n offset = 0;\n }\n if (!_Invert)\n {\n CreateHax(new Vector3(objPos.x + 1.7321f * _HexSize * _DistanceBetween * xas - offset, objPos.y, objPos.z + -1.5f * _HexSize * _DistanceBetween * zas));\n }\n else\n {\n CreateHax(new Vector3(objPos.x + 1.7321f * _HexSize * _DistanceBetween * xas - offset, objPos.y, objPos.z + +1.5f * _HexSize * _DistanceBetween * zas));\n }\n }\n }\n }\n void CreateHax(Vector3 positions)\n {\n Vector3 objPos = _CenterObj.transform.position;\n\n GameObject gridObj = GameObject.CreatePrimitive(PrimitiveType.Cube);\n gridObj.transform.position = new Vector3(positions.x, positions.y, positions.z);\n\n DestroyImmediate(gridObj.GetComponent<BoxCollider>());\n\n float size = _HexSize;\n float width = Mathf.Sqrt(3) * size;\n float height = size * 2f;\n Mesh mesh = new Mesh();\n Vector3[] vertices = new Vector3[7];\n\n for (int i = 0; i < 6; i++)\n {\n float angle_deg = 60 * i - 30;\n float angle_rad = Mathf.Deg2Rad * angle_deg;\n\n vertices[i + 1] = new Vector3(size * Mathf.Cos(angle_rad), 0f, size * Mathf.Sin(angle_rad));\n }\n mesh.vertices = vertices;\n\n mesh.triangles = new int[]\n {\n 2,1,0,\n 3,2,0,\n 4,3,0,\n 5,4,0,\n 6,5,0,\n 1,6,0\n };\n\n Vector2[] uv = new Vector2[7];\n for (int i = 0; i < 7; i++)\n {\n uv[i] = new Vector2(\n (vertices[i].x + -width * .5f) * .5f / size,\n (vertices[i].z + -height * .5f) * .5f / size);\n }\n\n mesh.uv = uv;\n gridObj.GetComponent<MeshFilter>().sharedMesh = mesh;\n\n _ObjSaved.Add(gridObj);\n }\n\n void SetParent()\n {\n for (int i = 0; i < _ObjSaved.Count; i++)\n {\n _ObjSaved[i].transform.parent = _CenterObj.transform;\n }\n }\n}\n"),
new Tool_QuickStart_Script("Tool_FileFinder", "Tool_File_Finder", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEditor;\nusing UnityEngine;\n\npublic class Tool_FileFinder : EditorWindow\n{\n //Tool State / Scrollpos\n int _ToolState = 0;\n int _ToolStateCheck = 1;\n Vector2 _ScrollPos = new Vector2();\n\n //Project\n string _Project_Type = \"\";\n string _Project_Search = \"\";\n string _Project_SearchCheck = \"a\";\n bool _Project_ExcludeMeta = true;\n int _Project_Results = 0;\n int _Project_Total = 0;\n\n //Project > Results\n string[] _SearchResults = new string[0];\n string[] _SearchResultsChange = new string[0];\n\n //Scene\n string _Scene_Search = \"\";\n bool _Scene_InsceneInfo = true;\n\n //Scene > Results\n bool[] _Scene_Objects_Toggle = new bool[0];\n GameObject[] _Scene_Objects = new GameObject[0];\n\n //GetWindow\n [MenuItem(\"Tools/Tool_FileFinder\")]\n public static void ShowWindow()\n {\n EditorWindow.GetWindow(typeof(Tool_FileFinder));\n }\n\n //Menu/HomePage\n void OnGUI()\n {\n _ToolState = GUILayout.Toolbar(_ToolState, new string[] { \"Assets\", \"Scene\" });\n\n if (_ToolState == 0)\n {\n FileFinder_Search();\n FileFinder_SearchProject();\n }\n else\n {\n FileFinder_SceneSearch();\n _Scene_InsceneInfo = EditorGUILayout.Toggle(\"InScene Info\", _Scene_InsceneInfo);\n FileFinder_Scene();\n }\n\n //stop focus when switching\n if(_ToolStateCheck != _ToolState)\n {\n EditorGUI.FocusTextInControl(\"searchproject\");\n _ToolStateCheck = _ToolState;\n } \n }\n\n //Project\n void FileFinder_Search()\n {\n _Project_Search = EditorGUILayout.TextField(\"Search:\", _Project_Search);\n _Project_Type = EditorGUILayout.TextField(\"Type:\", _Project_Type);\n _Project_ExcludeMeta = EditorGUILayout.Toggle(\"Exlude Meta:\", _Project_ExcludeMeta);\n GUILayout.Label(\"(\" + _Project_Results + \"/\" + _Project_Total + \")\");\n\n _Project_Results = 0;\n _Project_Total = 0;\n\n if (_Project_Search != _Project_SearchCheck)\n {\n _SearchResults = System.IO.Directory.GetFiles(\"Assets/\", \"*\" + _Project_Type, System.IO.SearchOption.AllDirectories);\n _SearchResultsChange = _SearchResults;\n _Project_SearchCheck = _Project_Search;\n }\n }\n void FileFinder_SearchProject()\n {\n _ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);\n for (int i = 0; i < _SearchResults.Length; i++)\n {\n if (_SearchResults[i].ToLower().Contains(_Project_Search.ToLower()))\n {\n if(_Project_ExcludeMeta)\n {\n if (!_SearchResults[i].ToLower().Contains(\".meta\"))\n FileFinder_SearchProject_Results(i);\n }\n else\n FileFinder_SearchProject_Results(i);\n }\n _Project_Total++;\n }\n EditorGUILayout.EndScrollView();\n }\n void FileFinder_SearchProject_Results(int id)\n {\n GUILayout.BeginHorizontal(\"Box\");\n GUILayout.Label(_SearchResults[id], GUILayout.Width(Screen.width - 80));\n if (GUILayout.Button(\"Select\", GUILayout.Width(50)))\n {\n Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(_SearchResults[id]);\n }\n GUILayout.EndHorizontal();\n _Project_Results++;\n }\n\n //Scene\n void FileFinder_SceneSearch()\n {\n _Scene_Search = EditorGUILayout.TextField(\"Search:\", _Scene_Search);\n GUILayout.Label(\"(\" + _Project_Results + \"/\" + _Project_Total + \")\");\n\n if (GUILayout.Button(\"Refresh\"))\n {\n _Scene_Objects = new GameObject[0];\n }\n\n _Project_Results = 0;\n _Project_Total = 0;\n\n if (_Scene_Objects.Length == 0)\n {\n _Scene_Objects = FindObjectsOfType<GameObject>();\n _Scene_Objects_Toggle = new bool[_Scene_Objects.Length];\n }\n }\n void FileFinder_Scene()\n {\n _ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);\n try\n {\n for (int i = 0; i < _Scene_Objects.Length; i++)\n {\n if (_Scene_Objects[i].name.ToLower().Contains(_Scene_Search.ToLower()))\n {\n GUILayout.BeginHorizontal(\"Box\");\n _Scene_Objects_Toggle[i] = EditorGUILayout.Foldout(_Scene_Objects_Toggle[i], \"\");\n\n GUILayout.Label(_Scene_Objects[i].name, GUILayout.Width(Screen.width - 80));\n if (GUILayout.Button(\"Select\", GUILayout.Width(50)))\n {\n Selection.activeObject = _Scene_Objects[i];\n }\n\n if (_Scene_Objects_Toggle[i])\n {\n GUILayout.EndHorizontal();\n GUILayout.BeginVertical(\"box\");\n _Scene_Objects[i].name = EditorGUILayout.TextField(\"Name:\", _Scene_Objects[i].name);\n _Scene_Objects[i].transform.position = EditorGUILayout.Vector3Field(\"Position:\", _Scene_Objects[i].transform.position);\n _Scene_Objects[i].transform.eulerAngles = EditorGUILayout.Vector3Field(\"Rotation:\", _Scene_Objects[i].transform.eulerAngles);\n GUILayout.EndVertical();\n GUILayout.BeginHorizontal();\n }\n\n GUILayout.EndHorizontal();\n _Project_Results++;\n }\n _Project_Total++;\n }\n }\n catch\n {\n _Scene_Objects = new GameObject[0];\n }\n EditorGUILayout.EndScrollView();\n }\n\n //wip\n void FileFinder_NameChange()\n {\n _ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);\n for (int i = 0; i < _SearchResults.Length; i++)\n {\n if (_SearchResults[i].ToLower().Contains(_Project_Search.ToLower()))\n {\n GUILayout.BeginHorizontal(\"Box\");\n _SearchResultsChange[i] = EditorGUILayout.TextField(\"Object Name: \", _SearchResultsChange[i]);\n if (GUILayout.Button(\"Save\", GUILayout.Width(50)))\n {\n _SearchResults[i] = _SearchResultsChange[i];\n Debug.Log(_SearchResults[i] + \" to > \" + _SearchResultsChange[i]);\n }\n if (GUILayout.Button(\"Revert\", GUILayout.Width(50)))\n {\n _SearchResultsChange[i] = _SearchResults[i];\n Debug.Log(_SearchResultsChange[i] + \" to > \" + _SearchResults[i]);\n }\n if (GUILayout.Button(\"Select\", GUILayout.Width(50)))\n {\n Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(_SearchResults[i]);\n }\n GUILayout.EndHorizontal();\n _Project_Results++;\n }\n _Project_Total++;\n }\n EditorGUILayout.EndScrollView();\n }\n\n //Enable/Disable\n void OnEnable()\n {\n SceneView.duringSceneGui += this.OnSceneGUI;\n }\n void OnDisable()\n {\n SceneView.duringSceneGui -= this.OnSceneGUI;\n }\n\n //OnSceneGUI\n void OnSceneGUI(SceneView sceneView)\n {\n try\n {\n if (_Scene_InsceneInfo)\n {\n Handles.color = new Color(0, 1, 0, 0.1f);\n for (int i = 0; i < _Scene_Objects.Length; i++)\n {\n if (_Scene_Objects[i].name.ToLower().Contains(_Scene_Search.ToLower()))\n {\n Handles.SphereHandleCap(1, _Scene_Objects[i].transform.position, Quaternion.identity, 3f, EventType.Repaint);\n Handles.Label(_Scene_Objects[i].transform.position, _Scene_Objects[i].name);\n }\n }\n }\n }\n catch { }\n }\n}\n"),
new Tool_QuickStart_Script("Tool_MapEditor", "Tool_Map_Editor", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEditor;\nusing UnityEditorInternal;\nusing System.IO;\n\npublic class Tool_MapEditor : EditorWindow\n{\n #region Array Icons\n //Prefab Array\n private GameObject[] _Prefabs = new GameObject[0];\n private string[] _SearchResults = new string[0];\n\n //Array Options\n private string _SearchPrefab = \"\";\n private bool _HideNames = true;\n private float _ButtonSize = 1, _CollomLength = 4;\n\n //Array Selection\n private int _SelectedID = 99999999, _CheckSelectedID = 999999999;\n #endregion\n #region Options\n //Options\n private bool _HideOptions = true;\n private int _OptionsStates = 0, _PlacementStates = 0;\n\n //Placement Option\n private float _PaintSpeed = 1, _PaintTimer = 0;\n private bool _SnapPosActive = false;\n\n //Onscene Options\n private bool _ShowOptionsInScene;\n private int _InScene_SelectedID;\n #endregion\n #region Transform\n //Position\n private Vector3 _MousePos, _SnapPos, _ObjectPos;\n private Vector2 _GridSize = new Vector2(1, 1);\n\n //Rotation/Size\n private float _Rotation, _Size = 1;\n private bool _RandomRot = false;\n private Vector2 _PrevMousePos = new Vector3(0, 0, 0);\n #endregion\n #region Check\n //Check Buttons Event\n private bool _MouseDown, _ShiftDown, _CtrlDown, _ClickMenu;\n #endregion\n #region Other\n //Placement\n private GameObject _ParentObj, _ExampleObj;\n\n //Other\n private Vector2 _ScrollPos1, _ClickPos;\n private Texture2D[] _PrefabIcon = new Texture2D[0];\n #endregion\n\n //Start Window\n [MenuItem(\"Tools/Map Editor %m\")]\n static void Init()\n {\n Tool_MapEditor window = EditorWindow.GetWindow(typeof(Tool_MapEditor), false, \"Tool_MapEditor\") as Tool_MapEditor;\n window.Show();\n }\n\n //Load Objects\n private void Awake()\n {\n Load_Prefabs();\n Load_Prefabs();\n }\n\n //Enable/Disable\n void OnEnable()\n {\n SceneView.duringSceneGui += this.OnSceneGUI;\n SceneView.duringSceneGui += this.OnScene;\n }\n void OnDisable()\n {\n SceneView.duringSceneGui -= this.OnSceneGUI;\n SceneView.duringSceneGui -= this.OnScene;\n DestroyImmediate(_ExampleObj);\n }\n\n //OnGUI ObjectView\n void OnGUI()\n {\n GUILayout.BeginVertical(\"Box\");\n\n //Refresh/Info\n GUILayout.BeginHorizontal();\n if (GUILayout.Button(\"Refresh\", GUILayout.Width(80)))\n {\n FixPreview();\n Load_Prefabs();\n }\n GUILayout.Label(\"Loaded objects: \" + _SearchResults.Length);\n GUILayout.EndHorizontal();\n\n //Windows\n ObjectView_Header();\n ObjectView_Objects();\n ObjectView_Options();\n\n GUILayout.EndVertical();\n }\n private void ObjectView_Header()\n {\n GUILayout.BeginHorizontal();\n _OptionsStates = GUILayout.Toolbar(_OptionsStates, new string[] { \"Icon\", \"Text\" });\n _ButtonSize = EditorGUILayout.Slider(_ButtonSize, 0.25f, 2);\n if (!_HideNames)\n {\n if (GUILayout.Button(\"Hide Names\", GUILayout.Width(100)))\n _HideNames = true;\n }\n else\n {\n if (GUILayout.Button(\"Show Names\", GUILayout.Width(100)))\n _HideNames = false;\n }\n GUILayout.EndHorizontal();\n _SearchPrefab = EditorGUILayout.TextField(\"Search: \", _SearchPrefab);\n }\n private void ObjectView_Objects()\n {\n Color defaultColor = GUI.backgroundColor;\n GUILayout.BeginVertical(\"Box\");\n float calcWidth = 100 * _ButtonSize;\n _CollomLength = position.width / calcWidth;\n int x = 0;\n int y = 0;\n\n //Show/Hide Options\n if (_HideOptions)\n _ScrollPos1 = GUILayout.BeginScrollView(_ScrollPos1, GUILayout.Width(position.width - 20), GUILayout.Height(position.height - 109));\n else\n {\n if (_PlacementStates == 0)\n _ScrollPos1 = GUILayout.BeginScrollView(_ScrollPos1, GUILayout.Width(position.width - 20), GUILayout.Height(position.height - 235));\n else\n _ScrollPos1 = GUILayout.BeginScrollView(_ScrollPos1, GUILayout.Width(position.width - 20), GUILayout.Height(position.height - 253));\n }\n\n //Object Icons\n for (int i = 0; i < _SearchResults.Length; i++)\n {\n if (_Prefabs[i] != null && _Prefabs[i].name.ToLower().Contains(_SearchPrefab.ToLower()))\n {\n if (_OptionsStates == 0) //Icons\n {\n //Select Color\n if (_SelectedID == i) { GUI.backgroundColor = new Color(0, 1, 0); } else { GUI.backgroundColor = new Color(1, 0, 0); }\n\n //Create Button\n GUIContent content = new GUIContent();\n content.image = _PrefabIcon[i];\n GUI.skin.button.imagePosition = ImagePosition.ImageAbove;\n if (!_HideNames)\n content.text = _Prefabs[i].name;\n if (GUI.Button(new Rect(x * 100 * _ButtonSize, y * 100 * _ButtonSize, 100 * _ButtonSize, 100 * _ButtonSize), content))\n if (_SelectedID == i) { _SelectedID = 99999999; _CheckSelectedID = 99999999; DestroyImmediate(_ExampleObj); } else { _SelectedID = i; }\n\n //Reset Button Position\n x++;\n if (x >= _CollomLength - 1)\n {\n y++;\n x = 0;\n }\n GUI.backgroundColor = defaultColor;\n }\n else //Text Buttons\n {\n if (_SelectedID == i) { GUI.backgroundColor = new Color(0, 1, 0); } else { GUI.backgroundColor = defaultColor; }\n if (GUILayout.Button(_Prefabs[i].name))\n if (_SelectedID == i) { _SelectedID = 99999999; _CheckSelectedID = 99999999; DestroyImmediate(_ExampleObj); } else { _SelectedID = i; }\n GUI.backgroundColor = defaultColor;\n }\n }\n }\n if (_OptionsStates == 0)\n {\n GUILayout.Space(y * 100 * _ButtonSize + 100);\n }\n GUILayout.EndScrollView();\n GUILayout.EndVertical();\n }\n private void ObjectView_Options()\n {\n GUILayout.BeginVertical(\"Box\");\n if (!_HideOptions)\n {\n //Paint Options\n GUILayout.BeginVertical(\"Box\");\n _PlacementStates = GUILayout.Toolbar(_PlacementStates, new string[] { \"Click\", \"Paint\" });\n if (_PlacementStates == 1)\n _PaintSpeed = EditorGUILayout.FloatField(\"Paint Speed: \", _PaintSpeed);\n //Parent Options\n GUILayout.BeginHorizontal();\n _ParentObj = (GameObject)EditorGUILayout.ObjectField(\"Parent Object: \", _ParentObj, typeof(GameObject), true);\n if (_ParentObj != null)\n if (GUILayout.Button(\"Clean Parent\"))\n CleanParent();\n GUILayout.EndHorizontal();\n GUILayout.EndVertical();\n\n //Grid Options\n GUILayout.BeginVertical(\"Box\");\n _GridSize = EditorGUILayout.Vector2Field(\"Grid Size: \", _GridSize);\n _RandomRot = EditorGUILayout.Toggle(\"Random Rotation: \", _RandomRot);\n _SnapPosActive = EditorGUILayout.Toggle(\"Use Grid: \", _SnapPosActive);\n GUILayout.EndVertical();\n }\n //Hide/Show Options\n if (_HideOptions)\n {\n if (GUILayout.Button(\"Show Options\"))\n _HideOptions = false;\n }\n else\n {\n if (GUILayout.Button(\"Hide Options\"))\n _HideOptions = true;\n }\n GUILayout.EndVertical();\n }\n\n //OnSceneGUI\n void OnSceneGUI(SceneView sceneView)\n {\n Event e = Event.current;\n Ray worldRay = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);\n RaycastHit hitInfo;\n\n if (Physics.Raycast(worldRay, out hitInfo))\n {\n //Check MousePosition\n _MousePos = hitInfo.point;\n\n //Create Example Object\n if (_SelectedID <= _Prefabs.Length)\n {\n if (_CheckSelectedID != _SelectedID)\n {\n DestroyImmediate(_ExampleObj);\n _ExampleObj = Instantiate(_Prefabs[_SelectedID], hitInfo.point, Quaternion.identity);\n _ExampleObj.layer = LayerMask.NameToLayer(\"Ignore Raycast\");\n for (int i = 0; i < _ExampleObj.transform.childCount; i++)\n {\n _ExampleObj.transform.GetChild(i).gameObject.layer = LayerMask.NameToLayer(\"Ignore Raycast\");\n for (int o = 0; o < _ExampleObj.transform.GetChild(i).childCount; o++)\n {\n _ExampleObj.transform.GetChild(i).GetChild(o).gameObject.layer = LayerMask.NameToLayer(\"Ignore Raycast\");\n }\n }\n _ExampleObj.name = \"Example Object\";\n _CheckSelectedID = _SelectedID;\n }\n }\n\n //Set Example Object Position + Rotation\n if (_ExampleObj != null)\n {\n _ExampleObj.transform.rotation = Quaternion.Euler(0, _Rotation, 0);\n _ExampleObj.transform.localScale = new Vector3(_Size, _Size, _Size);\n if (!e.shift && !e.control)\n {\n if (!_SnapPosActive)\n { _ExampleObj.transform.position = hitInfo.point; }\n else\n { _ExampleObj.transform.position = _SnapPos; }\n }\n }\n\n //Check Buttons Pressed\n if (!Event.current.alt && _SelectedID != 99999999)\n {\n if (Event.current.type == EventType.Layout)\n HandleUtility.AddDefaultControl(0);\n\n //Mouse Button 0 Pressed\n if (Event.current.type == EventType.MouseDown && Event.current.button == 0)\n {\n _MouseDown = true;\n _PaintTimer = _PaintSpeed;\n if (e.mousePosition.y <= 20)\n _ClickMenu = true;\n }\n\n //Mouse Button 0 Released\n if (Event.current.type == EventType.MouseUp && Event.current.button == 0)\n {\n _MouseDown = false;\n _ClickMenu = false;\n }\n\n //Check Shift\n if (e.shift)\n _ShiftDown = true;\n else\n _ShiftDown = false;\n\n //Check Ctrl\n if (e.control)\n _CtrlDown = true;\n else\n _CtrlDown = false;\n\n if (e.shift || e.control)\n {\n if (Event.current.type == EventType.MouseDown && Event.current.button == 0)\n _ClickPos = Event.current.mousePosition;\n }\n\n //Place Object\n if (!_ShiftDown && !_CtrlDown && !_ClickMenu)\n {\n if (_PlacementStates == 0)\n {\n if (Event.current.type == EventType.MouseDown && Event.current.button == 0)\n CreatePrefab(hitInfo.point);\n }\n else\n {\n float timer1Final = _PaintSpeed;\n if (_MouseDown)\n {\n _PaintTimer += 1 * Time.deltaTime;\n if (_PaintTimer >= timer1Final)\n {\n CreatePrefab(hitInfo.point);\n _PaintTimer = 0;\n }\n }\n }\n }\n }\n\n // Draw obj location\n if (_SelectedID != 99999999)\n {\n //Draw Red Cross + Sphere on object location\n Handles.color = new Color(1, 0, 0);\n Handles.DrawLine(new Vector3(hitInfo.point.x - 0.3f, hitInfo.point.y, hitInfo.point.z), new Vector3(hitInfo.point.x + 0.3f, hitInfo.point.y, hitInfo.point.z));\n Handles.DrawLine(new Vector3(hitInfo.point.x, hitInfo.point.y, hitInfo.point.z - 0.3f), new Vector3(hitInfo.point.x, hitInfo.point.y, hitInfo.point.z + 0.3f));\n if (_SnapPosActive)\n {\n Handles.SphereHandleCap(1, new Vector3(_SnapPos.x, hitInfo.point.y, _SnapPos.z), Quaternion.identity, 0.1f, EventType.Repaint);\n }\n else\n Handles.SphereHandleCap(1, new Vector3(hitInfo.point.x, hitInfo.point.y, hitInfo.point.z), Quaternion.identity, 0.1f, EventType.Repaint);\n\n //Check Snap Position\n if (_SnapPosActive)\n {\n Vector2 calc = new Vector2(_MousePos.x / _GridSize.x, _MousePos.z / _GridSize.y);\n Vector2 calc2 = new Vector2(Mathf.RoundToInt(calc.x) * _GridSize.x, Mathf.RoundToInt(calc.y) * _GridSize.y);\n\n _SnapPos = new Vector3(calc2.x, _MousePos.y, calc2.y);\n\n //Draw Grid\n Handles.color = new Color(0, 1, 0);\n float lineLength = 0;\n if (_GridSize.x > _GridSize.y)\n lineLength = _GridSize.x + 1;\n else\n lineLength = _GridSize.y + 1;\n\n for (int hor = 0; hor < 3; hor++)\n {\n Handles.DrawLine(new Vector3(calc2.x - lineLength, hitInfo.point.y, calc2.y - _GridSize.y + _GridSize.y * hor), new Vector3(calc2.x + lineLength, hitInfo.point.y, calc2.y - _GridSize.y + _GridSize.y * hor));\n }\n for (int ver = 0; ver < 3; ver++)\n {\n Handles.DrawLine(new Vector3(calc2.x - _GridSize.x + _GridSize.x * ver, hitInfo.point.y, calc2.y - lineLength), new Vector3(calc2.x - _GridSize.x + _GridSize.x * ver, hitInfo.point.y, calc2.y + lineLength));\n }\n }\n }\n }\n }\n\n //OnScene\n void OnScene(SceneView sceneView)\n {\n //InScene Option Bar\n Handles.BeginGUI();\n if (_ShowOptionsInScene)\n {\n //Option Bar\n GUI.Box(new Rect(0, 0, Screen.width, 22), GUIContent.none);\n _InScene_SelectedID = GUI.Toolbar(new Rect(22, 1, Screen.width / 2 - 30, 20), _InScene_SelectedID, new string[] { \"Settings\", \"Placement\", \"Transform\", \"Grid\" });\n switch (_InScene_SelectedID)\n {\n case 0: //Settings\n GUI.Label(new Rect(Screen.width / 2 - 5, 3, 50, 20), \"Parent: \");\n _ParentObj = (GameObject)EditorGUI.ObjectField(new Rect(Screen.width / 2 + 50, 1, 150, 20), _ParentObj, typeof(GameObject), true);\n if (GUI.Button(new Rect(Screen.width - 110, 1, 90, 20), \"Clean Parent\"))\n {\n CleanParent();\n }\n break;\n case 1: //Placement\n _PlacementStates = GUI.Toolbar(new Rect(Screen.width / 2 - 5, 1, 100, 20), _PlacementStates, new string[] { \"Click\", \"Paint\" });\n _PaintSpeed = EditorGUI.FloatField(new Rect(Screen.width / 2 + 185, 1, 50, 20), _PaintSpeed);\n GUI.Label(new Rect(Screen.width / 2 + 100, 3, 500, 20), \"Paint speed: \");\n break;\n case 2: //Transform\n _Size = EditorGUI.FloatField(new Rect(Screen.width / 2 + 125, 1, 100, 20), _Size);\n break;\n case 3: //Grid\n GUI.Label(new Rect(Screen.width / 2 + 80, 3, 100, 20), \"Grid Size: \");\n _GridSize.x = EditorGUI.FloatField(new Rect(Screen.width / 2 + 150, 1, 50, 20), _GridSize.x);\n _GridSize.y = EditorGUI.FloatField(new Rect(Screen.width / 2 + 200, 1, 50, 20), _GridSize.y);\n GUI.Label(new Rect(Screen.width / 2, 3, 100, 20), \"Enable: \");\n _SnapPosActive = EditorGUI.Toggle(new Rect(Screen.width / 2 + 50, 3, 20, 20), _SnapPosActive);\n break;\n }\n }\n\n //Hotkeys Resize / Rotate\n //Shift+MouseDown = Resize\n Vector2 prevmove = _PrevMousePos - Event.current.mousePosition;\n if (_ShiftDown && _MouseDown)\n {\n _Size = EditorGUI.Slider(new Rect(_ClickPos.x - 15, _ClickPos.y - 40, 50, 20), _Size, 0.01f, 1000000);\n _Size -= (prevmove.x + prevmove.y) * 0.05f;\n GUI.Label(new Rect(_ClickPos.x - 50, _ClickPos.y - 40, 500, 20), \"Size: \");\n }\n //Ctrl+MouseDown = Rotate\n if (_CtrlDown && _MouseDown)\n {\n _Rotation = EditorGUI.Slider(new Rect(_ClickPos.x - 15, _ClickPos.y - 40, 50, 20), _Rotation, -1000000, 1000000);\n _Rotation += prevmove.x + prevmove.y;\n GUI.Label(new Rect(_ClickPos.x - 80, _ClickPos.y - 40, 500, 20), \"Rotation: \");\n }\n _PrevMousePos = Event.current.mousePosition;\n\n //Inscene Show OptionButton\n GUI.color = new Color(1f, 1f, 1f, 1f);\n if (!_ShowOptionsInScene)\n {\n if (GUI.Button(new Rect(1, 1, 20, 20), \" +\"))\n _ShowOptionsInScene = true;\n }\n else\n {\n if (GUI.Button(new Rect(1, 1, 20, 20), \" -\"))\n _ShowOptionsInScene = false;\n }\n Handles.EndGUI();\n }\n\n //Load/Fix\n void Load_Prefabs()\n {\n _SearchResults = System.IO.Directory.GetFiles(\"Assets/\", \"*.prefab\", System.IO.SearchOption.AllDirectories);\n _Prefabs = new GameObject[_SearchResults.Length];\n _PrefabIcon = new Texture2D[_SearchResults.Length];\n\n for (int i = 0; i < _SearchResults.Length; i++)\n {\n Object prefab = null;\n prefab = AssetDatabase.LoadAssetAtPath(_SearchResults[i], typeof(GameObject));\n _Prefabs[i] = prefab as GameObject;\n _PrefabIcon[i] = AssetPreview.GetAssetPreview(_Prefabs[i]);\n }\n }\n void FixPreview()\n {\n Load_Prefabs();\n _SearchResults = System.IO.Directory.GetFiles(\"Assets/\", \"*.prefab\", System.IO.SearchOption.AllDirectories);\n\n for (int i = 0; i < _SearchResults.Length; i++)\n {\n if (_PrefabIcon[i] == null)\n AssetDatabase.ImportAsset(_SearchResults[i]);\n }\n Load_Prefabs();\n }\n\n //Create Prefab/Clean Parent\n void CreatePrefab(Vector3 createPos)\n {\n if (CheckPositionEmpty(true))\n {\n GameObject createdObj = PrefabUtility.InstantiatePrefab(_Prefabs[_SelectedID]) as GameObject;\n createdObj.transform.position = createPos;\n createdObj.transform.localScale = new Vector3(_Size, _Size, _Size);\n\n if (_ParentObj == null)\n {\n _ParentObj = new GameObject();\n _ParentObj.name = \"MapEditor_Parent\";\n }\n\n createdObj.transform.parent = _ParentObj.transform;\n if (_SnapPosActive)\n createdObj.transform.position = _SnapPos;\n else\n createdObj.transform.position = _MousePos;\n if (_RandomRot)\n createdObj.transform.rotation = Quaternion.Euler(0, Random.Range(0, 360), 0);\n else\n createdObj.transform.rotation = Quaternion.Euler(0, _Rotation, 0);\n }\n }\n void CleanParent()\n {\n int childAmount = _ParentObj.transform.childCount;\n int childCalc = childAmount - 1;\n for (int i = 0; i < childAmount; i++)\n {\n DestroyImmediate(_ParentObj.transform.GetChild(childCalc).gameObject);\n childCalc -= 1;\n }\n }\n bool CheckPositionEmpty(bool checky)\n {\n if (_ParentObj != null)\n {\n bool check = true;\n for (int i = 0; i < _ParentObj.transform.childCount; i++)\n {\n if (checky)\n {\n if (_ParentObj.transform.GetChild(i).position.x == _SnapPos.x && _ParentObj.transform.GetChild(i).position.z == _SnapPos.z)\n check = false;\n }\n else\n if (_ParentObj.transform.GetChild(i).position == _SnapPos)\n check = false;\n }\n return check;\n }\n else\n {\n return true;\n }\n }\n}\n"),
new Tool_QuickStart_Script("Tool_ScriptToString", "Tool_Editor", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing UnityEditor;\nusing UnityEngine;\n\npublic class Tool_ScriptToString : EditorWindow\n{\n MonoScript _InputScript;\n string _ScriptOutput = \"\";\n\n private Vector2 _ScrollPos = new Vector2();\n\n [MenuItem(\"Tools/Convert Script to String\")]\n public static void ShowWindow()\n {\n EditorWindow.GetWindow(typeof(Tool_ScriptToString));\n }\n\n void OnGUI()\n {\n if (GUILayout.Button(\"Convert\", GUILayout.Height(30)))\n if(_InputScript != null)\n _ScriptOutput = ConvertScriptToString();\n\n _ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);\n Display_InputOutput();\n Display_StringExample();\n EditorGUILayout.EndScrollView();\n }\n\n private void Display_InputOutput()\n {\n GUILayout.Space(20);\n //Input\n GUILayout.Label(\"Input: \", EditorStyles.boldLabel);\n _InputScript = EditorGUILayout.ObjectField(_InputScript, typeof(MonoScript), false) as MonoScript;\n\n //Output\n GUILayout.Label(\"Output: \", EditorStyles.boldLabel);\n EditorGUILayout.TextField(\"\", _ScriptOutput);\n GUILayout.Space(20);\n }\n\n private void Display_StringExample()\n {\n //Preview\n List<string> output = new List<string>();\n List<string> output2 = new List<string>();\n\n for (int i = 0; i < _ScriptOutput.Length; i++)\n {\n output.Add(System.Convert.ToString(_ScriptOutput[i]));\n }\n\n int begincalc = 0;\n int endcalc = 0;\n\n for (int i = 0; i < output.Count; i++)\n {\n if (i + 1 < output.Count)\n {\n if (output[i] + output[i + 1] == \"\\\\n\")\n {\n endcalc = i;\n string addstring = \"\";\n for (int j = 0; j < endcalc - begincalc; j++)\n {\n addstring += output[begincalc + j];\n }\n addstring += output[endcalc] + output[endcalc + 1];\n\n output2.Add(addstring);\n endcalc = endcalc + 1;\n begincalc = endcalc + 1;\n }\n }\n }\n\n for (int i = 0; i < output2.Count; i++)\n {\n GUILayout.BeginHorizontal();\n if (output2[i].Contains(\"//\"))\n {\n EditorGUILayout.TextField(\"\", \"x\", GUILayout.MaxWidth(15));\n }\n else\n {\n EditorGUILayout.TextField(\"\", \"\", GUILayout.MaxWidth(15));\n }\n\n EditorGUILayout.TextField(\"\", output2[i]);\n GUILayout.EndHorizontal();\n }\n }\n\n private string ConvertScriptToString()\n {\n string newstring = \"\\\"\";\n string path = GetPath();\n string[] readText = File.ReadAllLines(path);\n\n for (int i = 0; i < readText.Length; i++)\n {\n string newline = \"\";\n for (int j = 0; j < readText[i].Length; j++)\n {\n if(System.Convert.ToString(readText[i][j]) == \"\\\"\")\n newline += \"\\\\\";\n newline += System.Convert.ToString(readText[i][j]);\n }\n readText[i] = newline + \"\\\\n\";\n newstring += readText[i];\n }\n\n newstring += \"\\\"\";\n\n return newstring;\n }\n\n private string GetPath()\n {\n string[] filepaths = System.IO.Directory.GetFiles(\"Assets/\", \"*.cs\", System.IO.SearchOption.AllDirectories);\n for (int i = 0; i < filepaths.Length; i++)\n {\n if (filepaths[i].Contains(_InputScript.name + \".cs\"))\n {\n return filepaths[i];\n }\n }\n return \"\";\n }\n}\n"),
new Tool_QuickStart_Script("Turret", "Turret_Shooting", "stable", "", "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class Turret : MonoBehaviour\n{\n [Header(\"Settings\")]\n [SerializeField] private Vector2 _MinMaxRange = Vector2.zero;\n [SerializeField] private float _SecondsBetweenShots = 2;\n [SerializeField] private float _Damage = 25;\n [SerializeField] private GameObject _ShootPart = null;\n [SerializeField] private string _Tag = \"Enemy\";\n \n private float _Timer;\n private GameObject _Target;\n\n void Update()\n {\n if (_Target != null)\n {\n _ShootPart.transform.LookAt(_Target.transform.position);\n _Timer += 1 * Time.deltaTime;\n if (_Timer >= _SecondsBetweenShots)\n {\n _Target.GetComponent<Health>().DoDamage(_Damage);\n _Timer = 0;\n }\n }\n else\n {\n _ShootPart.transform.rotation = Quaternion.Euler(90, 0, 0);\n }\n\n _Target = FindEnemy();\n }\n\n public GameObject FindEnemy()\n {\n GameObject[] m_Targets = GameObject.FindGameObjectsWithTag(_Tag);\n GameObject closest = null;\n float distance = Mathf.Infinity;\n Vector3 position = transform.position;\n\n _MinMaxRange.x = _MinMaxRange.x * _MinMaxRange.x;\n _MinMaxRange.y = _MinMaxRange.y * _MinMaxRange.y;\n foreach (GameObject target in m_Targets)\n {\n Vector3 diff = target.transform.position - position;\n float curDistance = diff.sqrMagnitude;\n if (curDistance < distance && curDistance >= _MinMaxRange.x && curDistance <= _MinMaxRange.y)\n {\n closest = target;\n distance = curDistance;\n }\n }\n return closest;\n }\n}\n"),
new Tool_QuickStart_Script("UIEffects", "UI_Effect", "stable", "", "using UnityEngine;\nusing UnityEngine.EventSystems;\n\npublic class UIEffects : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler\n{\n private enum UIEffectOptions { Grow, Shrink }\n [Header(\"Effects\")]\n [SerializeField] private UIEffectOptions _UIEffect = UIEffectOptions.Grow;\n\n [Header(\"Scaling Options\")]\n [SerializeField] private bool _RelativeToOriginalSize = true;\n [SerializeField] private float _IncreaseSpeed = 1;\n\n [Header(\"Minimal Size:\")]\n [SerializeField] private float _MinimalSize = 0.9f;\n\n [Header(\"Maximal Size:\")]\n [SerializeField] private float _MaximalSize = 1.1f;\n\n private Vector3 _OriginalSize;\n private bool _MouseOver;\n\n void OnEnable()\n {\n _MouseOver = false;\n }\n\n void Start()\n {\n _OriginalSize = transform.localScale;\n\n if (_RelativeToOriginalSize)\n {\n _MinimalSize = _OriginalSize.y * _MinimalSize;\n _MaximalSize = _OriginalSize.y * _MaximalSize;\n _IncreaseSpeed = _IncreaseSpeed * ((_OriginalSize.x + _OriginalSize.y + _OriginalSize.z) / 3);\n }\n }\n\n void Update()\n {\n switch (_UIEffect)\n {\n case UIEffectOptions.Grow:\n if (_MouseOver)\n {\n if (transform.localScale.y < _MaximalSize)\n transform.localScale += new Vector3(_IncreaseSpeed, _IncreaseSpeed, _IncreaseSpeed) * Time.unscaledDeltaTime;\n }\n else\n if (transform.localScale.y > _OriginalSize.y)\n transform.localScale -= new Vector3(_IncreaseSpeed, _IncreaseSpeed, _IncreaseSpeed) * Time.unscaledDeltaTime;\n else\n transform.localScale = new Vector3(_OriginalSize.x, _OriginalSize.y, _OriginalSize.z);\n break;\n case UIEffectOptions.Shrink:\n if (_MouseOver)\n {\n if (transform.localScale.y > _MinimalSize)\n transform.localScale -= new Vector3(_IncreaseSpeed, _IncreaseSpeed, _IncreaseSpeed) * Time.unscaledDeltaTime;\n }\n else\n if (transform.localScale.y < _OriginalSize.y)\n transform.localScale += new Vector3(_IncreaseSpeed, _IncreaseSpeed, _IncreaseSpeed) * Time.unscaledDeltaTime;\n else\n transform.localScale = new Vector3(_OriginalSize.x, _OriginalSize.y, _OriginalSize.z);\n break;\n }\n }\n\n public void OnPointerEnter(PointerEventData eventData)\n {\n _MouseOver = true;\n }\n\n public void OnPointerExit(PointerEventData eventData)\n {\n _MouseOver = false;\n }\n}\n"
)};
bool[] _Scripts_AddMultiple = new bool[0];
bool _Scripts_AddMultiple_Active = false;
int _Scripts_AddMultiple_Amount = 0;
int _Scripts_ShowDescription = -1;
//Settings
Vector2 _ScrollPos = new Vector2();
bool[] _UpdateLogFoldout = new bool[3];
bool _ScriptDescriptionEnable = false;
bool _ScriptOptionsFoldout = false;
int _ThisorNewScene = 0;
//Search
string[] _Project_Scripts = new string[0];
string _Search_Script = "";
string _Search_Window = "";
string _Search_Tag = "";
DateTime _Search_RefreshTime = DateTime.Now;
bool _Search_QuickStartScripts_Toggle = true;
bool _Search_ProjectScripts_Toggle = false;
bool _Search_UpToDate_HasChecked = false;
bool _Search_UpToDate_Toggle = false;
bool _Search_Compare_Toggle = false;
public int _Search_CompareID = 0;
int _Search_ProjectScripts_Results = 0;
int _Search_ProjectScripts_Total = 0;
int _Search_InProject_Results = 0;
int _Search_UpToDate_Amount = 0;
int _Search_UpToDate_Total = 0;
int _Search_Results = 0;
//HUD
bool _HUD_EnableLiveEdit = true;
int _HUD_TabID;
List<Tool_QuickStartUI_Tab> _HUD_Tab = new List<Tool_QuickStartUI_Tab>();
enum HUDProfiles { BasicStartMenu, AdvanceStartMenu_wip };
HUDProfiles _HUD_Profiles;
//Other
Vector2 _CheckMainCanvasRectSize;
RectTransform _MainCanvasRect;
GameObject _MainCanvas;
bool _SearchOnStartup = false;
//Scene Window
List<Tool_QuickStart_SceneOrganizer_GameObjectProfile_All> _Scene_AllObjects = new List<Tool_QuickStart_SceneOrganizer_GameObjectProfile_All>();
List<Tool_QuickStart_SceneOrganizer> _Scene_Snapshot = new List<Tool_QuickStart_SceneOrganizer>();
string[] _Scene_StructureOptions = new string[] {
"Essentials",
"Canvas",
"Map",
"Lighting",
"Other"};
string _SceneObjects_SearchComponent = "";
string _SceneObjects_SearchScript = "";
string _SceneObjects_Search = "";
bool _SceneObjects_Filter_ShowComponents = false;
bool _SceneObjects_Show_SceneStructure = false;
bool _SceneObjects_Show_SceneAllObject = true;
bool _SceneObjects_Filter_ShowScripts = false;
bool _SceneObjects_Filter_HasScript = false;
bool _SceneObjects_ShowSnapshot = true;
bool[] _Scene_Structure = new bool[0];
Vector2 _Scene_Scroll;
//FileFinder (FF) ----------------------------------------------
#region FileFinder
string _FF_Type = "";
string _FF_TypeCheck = "";
string _FF_Search = "";
string _FF_SearchCheck = "a";
int _FF_Results = 0;
int _FF_Total = 0;
int _FF_State = 0;
int _FF_StateCheck = 1;
bool _FF_LockOptionActive = true;
bool _FF_ExcludeMeta = true;
//Scene
string _FF_Scene_Search = "";
bool _FF_Scene_InsceneInfo = true;
bool _FF_ExtraOptions_Foldout = false;
int _FF_InSceneInfoAmount = 500;
bool[] _FF_Scene_Objects_Toggle = new bool[0];
bool[] _FF_Scene_Objects_Lock = new bool[0];
GameObject[] _FF_Scene_Objects = new GameObject[0];
//Results
string[] _FF_SearchResults = new string[0];
#endregion
//Script To String (STS) ----------------------------------------------
#region Script To String
MonoScript _STS_InputScript = null;
string _STS_ScriptOutput = "";
#endregion
//Map Editor (ME) ----------------------------------------------
#region MapEditor
//Prefab Array
GameObject[] _ME_Prefabs = new GameObject[0];
string[] _ME_SearchResults = new string[0];
//Array Options
string _ME_SearchPrefab = "";
bool _ME_HideNames = true;
float _ME_ButtonSize = 1, _ME_CollomLength = 4;
//Array Selection
int _ME_SelectedID = 99999999, _ME_CheckSelectedID = 999999999;
//Options
bool _ME_HideOptions = true;
int _ME_OptionsStates = 0, _ME_PlacementStates = 0;
//Placement Option
float _ME_PaintSpeed = 1, _ME_PaintTimer = 0;
bool _ME_SnapPosActive = false;
//Onscene Options
bool _ME_ShowOptionsInScene;
int _ME_InScene_SelectedID;
//Position
Vector3 _ME_MousePos, _ME_SnapPos, _ME_ObjectPos;
Vector2 _ME_GridSize = new Vector2(1, 1);
//Rotation/Size
float _ME_Rotation, _ME_Size = 1;
bool _ME_RandomRot = false;
Vector2 _ME_PrevMousePos = new Vector3(0, 0, 0);
//Check Buttons Event
bool _ME_MouseDown, _ME_ShiftDown, _ME_CtrlDown, _ME_ClickMenu;
//Placement
GameObject _ME_ParentObj, _ME_ExampleObj;
Transform _ME_HitObject;
bool _ME_RotateWithObject = false;
//Other
Vector2 _ME_ScrollPos1, _ME_ClickPos;
Texture2D[] _ME_PrefabIcon = new Texture2D[0];
bool _ME_FirstLoad = true;
#endregion
public static Tool_QuickStart TOOL;
[MenuItem("Tools/Tool_QuickStart %q")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(Tool_QuickStart));
}
//Menu
void OnGUI()
{
GUILayout.Label(_Version + " (" + _UpdateDate + ")");
GUILayout.BeginHorizontal();
if (GUILayout.Button("=", GUILayout.Width(20)))
{
_WindowID = 0;
_SelectWindow = !_SelectWindow;
}
if (GUILayout.Button("?", GUILayout.Width(20)))
{
if (_WindowID == 1)
_WindowID = 0;
else
_WindowID = 1;
_SelectWindow = false;
}
if (_SelectWindow)
{
GUILayout.Label("Tool Navigation");
GUILayout.EndHorizontal();
_Search_Window = EditorGUILayout.TextField("Search: ", _Search_Window);
for (int i = 2; i < _WindowNames.Length; i++)
{
if (_Search_Window == "" || _WindowNames[i].ToLower().Contains(_Search_Window.ToLower()))
if (GUILayout.Button(_WindowNames[i], GUILayout.Height(30))) { _WindowID = i; _SelectWindow = false; _Search_Window = ""; ChangeTab(); }
}
}
else
{
switch (_WindowID)
{
case 0: //Default
//Menu Type
_MenuID = GUILayout.Toolbar(_MenuID, new string[] { "QuickStart", "Scripts", "QuickUI (wip)", "Scene (wip)" });
GUILayout.EndHorizontal();
switch (_MenuID)
{
case 0: //QuickStart
Menu_QuickStart();
break;
case 1: //Scripts
Menu_Scripts();
break;
case 2: //QuickUI
Menu_QuickUI();
break;
case 3: //Scene
Menu_Scene();
break;
}
break;
case 1: //UpdateLog
GUILayout.EndHorizontal();
UpdateLog();
break;
case 2: //FileFinder
GUILayout.EndHorizontal();
FileFinder();
break;
case 3: //ScriptToString
GUILayout.EndHorizontal();
ScriptToString_Menu();
break;
case 4: //MapEditor
GUILayout.EndHorizontal();
MapEditor_Menu();
break;
}
}
}
//Home > QuickStart : Menu
void Menu_QuickStart()
{
//FirstSearch
if (!_SearchOnStartup)
{
SearchScripts();
_SearchOnStartup = true;
}
//Dimension
_DimensionID = GUILayout.Toolbar(_DimensionID, new string[] { "2D", "3D" });
//Type 2D/3D
switch (_DimensionID)
{
case 0:
_Type2DID = GUILayout.Toolbar(_Type2DID, new string[] { "Platformer", "TopDown", "VisualNovel (wip)" });
break;
case 1:
_Type3DID = GUILayout.Toolbar(_Type3DID, new string[] { "FPS", "ThirdPerson", "TopDown", "Platformer" });
break;
}
//Info
_ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);
if (_DimensionID == 0)
Menu_QuickStart2D();
else
Menu_QuickStart3D();
//Create/Refresh
GUI.backgroundColor = Color.white;
GUILayout.Label("Build Options", EditorStyles.boldLabel);
_ThisorNewScene = GUILayout.Toolbar(_ThisorNewScene, new string[] { "New scene", "This scene" });
EditorGUILayout.EndScrollView();
if (GUILayout.Button("Create"))
CreateTemplate();
if (GUILayout.Button("Refresh"))
SearchScripts();
}
void Menu_QuickStart2D()
{
switch (_Type2DID)
{
case 0: //Platformer
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_2D_Platformer");
ScriptStatus("Movement_Camera");
GUILayout.Label("Extra", EditorStyles.boldLabel);
break;
case 1: //TopDown
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_2D_TopDown");
ScriptStatus("Movement_Camera");
GUILayout.Label("Extra", EditorStyles.boldLabel);
break;
case 2: //VisualNovel
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("DialogSystem");
ScriptStatus("DialogSystemEditor");
GUILayout.Label("Extra", EditorStyles.boldLabel);
break;
}
}
void Menu_QuickStart3D()
{
switch (_Type3DID)
{
case 0: //FPS
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_CC_FirstPerson");
GUILayout.Label("Recommended", EditorStyles.boldLabel);
ScriptStatus("ObjectPool");
GUILayout.Label("Shooter", EditorStyles.boldLabel);
ScriptStatus("Health");
ScriptStatus("Bullet");
GUILayout.Label("Interactions", EditorStyles.boldLabel);
ScriptStatus("InteractionHandler");
ScriptStatus("Interactable");
break;
case 1: //ThirdPerson
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_CC_FirstPerson");
GUILayout.Label("Extra", EditorStyles.boldLabel);
ScriptStatus("Health");
break;
case 2: //TopDown
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_CC_TopDown");
GUILayout.Label("Extra", EditorStyles.boldLabel);
ScriptStatus("Health");
break;
case 3: //Platformer
GUILayout.Label("Essential", EditorStyles.boldLabel);
ScriptStatus("Movement_CC_Platformer");
GUILayout.Label("Extra", EditorStyles.boldLabel);
ScriptStatus("Health");
break;
}
}
//Home > QuickStart : CreateScene
void CreateTemplate()
{
if (_ThisorNewScene == 0)
{
Scene newScene = EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
}
CreateObjects();
}
void CreateObjects()
{
//Check Scripts
SearchScripts();
//3D
if (_DimensionID == 1)
{
GameObject groundCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
groundCube.name = "Ground";
groundCube.transform.position = new Vector3(0, 0, 0);
GameObject player = GameObject.CreatePrimitive(PrimitiveType.Capsule);
player.name = "Player";
player.transform.position = new Vector3(0, 2, 0);
GameObject cameraObj = GameObject.Find("Main Camera");
switch (_Type3DID)
{
case 0: //FPS
CreateObjects_3D_FPS(player, groundCube, cameraObj);
break;
case 1: //ThirdPerson
CreateObjects_3D_ThirdPerson(player, groundCube, cameraObj);
break;
case 2: //TopDown
CreateObjects_3D_TopDown(player, groundCube, cameraObj);
break;
case 3: //Platformer
CreateObjects_3D_Platformer(player, groundCube, cameraObj);
break;
}
}
//2D
if (_DimensionID == 0)
{
GameObject groundCube = GameObject.CreatePrimitive(PrimitiveType.Quad);
DestroyImmediate(groundCube.GetComponent<MeshCollider>());
groundCube.AddComponent<BoxCollider2D>();
groundCube.name = "Ground";
groundCube.transform.position = new Vector3(0, 0, 0);
GameObject player = GameObject.CreatePrimitive(PrimitiveType.Quad);
DestroyImmediate(player.GetComponent<MeshCollider>());
player.AddComponent<BoxCollider2D>();
player.name = "Player";
player.transform.position = new Vector3(0, 2, 0);
GameObject cameraObj = GameObject.Find("Main Camera");
Camera cam = cameraObj.GetComponent<Camera>();
cam.orthographic = true;
switch (_Type2DID)
{
case 0: //Platformer
CreateObjects_2D_Platformer(player, groundCube, cameraObj);
break;
case 1: //TopDown
CreateObjects_2D_TopDown(player, groundCube, cameraObj);
break;
case 2: //VisualNovel
CreateObjects_2D_VisualNovel(player, groundCube);
break;
}
}
}
//Home > QuickStart : Create Objects 3D / Set scripts
void CreateObjects_3D_FPS(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
//Setup Level
groundobj.transform.localScale = new Vector3(25, 1, 25);
cameraobj.transform.parent = playerobj.transform;
cameraobj.transform.localPosition = new Vector3(0, 0.65f, 0);
GameObject objpool = null;
//Setup Scripts
if (ScriptExist("Health"))
{
string UniType = "Health";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("ObjectPool"))
{
objpool = new GameObject();
string UniType = "ObjectPool";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
objpool.AddComponent(UnityType);
objpool.name = "ObjectPool";
}
if (ScriptExist("Movement_CC_FirstPerson"))
{
string UniType = "Movement_CC_FirstPerson";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
}
void CreateObjects_3D_ThirdPerson(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
//Setup Level
groundobj.transform.localScale = new Vector3(25, 1, 25);
GameObject rotationPoint = GameObject.CreatePrimitive(PrimitiveType.Cube);
rotationPoint.name = "rotationPoint";
rotationPoint.transform.position = new Vector3(0, 2, 0);
cameraobj.transform.parent = rotationPoint.transform;
cameraobj.transform.localPosition = new Vector3(1, 0.65f, -1.5f);
rotationPoint.transform.parent = playerobj.transform;
DestroyImmediate(rotationPoint.GetComponent<BoxCollider>());
rotationPoint.GetComponent<MeshRenderer>().enabled = false;
//Setup Scripts
if (ScriptExist("Health"))
{
string UniType = "Health";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_CC_FirstPerson"))
{
string UniType = "Movement_CC_FirstPerson";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
}
void CreateObjects_3D_TopDown(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
//Setup Level
groundobj.transform.localScale = new Vector3(25, 1, 25);
cameraobj.transform.position = new Vector3(0, 10, -1.5f);
cameraobj.transform.eulerAngles = new Vector3(80, 0, 0);
//Setup Scripts
if (ScriptExist("Health"))
{
string UniType = "Health";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_CC_TopDown"))
{
string UniType = "Movement_CC_TopDown";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
playerobj.GetComponent(UnityType).SendMessage("SetCamera", cameraobj.GetComponent<Camera>());
}
if (ScriptExist("Movement_Camera"))
{
string UniType = "Movement_Camera";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
cameraobj.AddComponent(UnityType);
cameraobj.GetComponent(UnityType).SendMessage("Set_CameraTarget", playerobj);
}
}
void CreateObjects_3D_Platformer(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
//Setup Level
groundobj.transform.localScale = new Vector3(25, 1, 1);
//Setup Scripts
if (ScriptExist("Health"))
{
string UniType = "Health";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_CC_Platformer"))
{
string UniType = "Movement_CC_Platformer";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_Camera"))
{
string UniType = "Movement_Camera";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
cameraobj.AddComponent(UnityType);
cameraobj.GetComponent(UnityType).SendMessage("Set_CameraTarget", playerobj);
cameraobj.GetComponent(UnityType).SendMessage("Set_OffSet", new Vector3(0, 5, -10));
}
}
//Home > QuickStart : Create Object 2D / Set scripts
void CreateObjects_2D_Platformer(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
groundobj.transform.localScale = new Vector3(25, 1, 1);
if (ScriptExist("Movement_2D_Platformer"))
{
string UniType = "Movement_2D_Platformer";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_Camera"))
{
string UniType = "Movement_Camera";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
cameraobj.AddComponent(UnityType);
cameraobj.GetComponent(UnityType).SendMessage("Set_CameraTarget", playerobj);
cameraobj.GetComponent(UnityType).SendMessage("Set_OffSet", new Vector3(0, 3, -10));
}
}
void CreateObjects_2D_TopDown(GameObject playerobj, GameObject groundobj, GameObject cameraobj)
{
DestroyImmediate(groundobj);
if (ScriptExist("Movement_2D_TopDown"))
{
string UniType = "Movement_2D_TopDown";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
playerobj.AddComponent(UnityType);
}
if (ScriptExist("Movement_Camera"))
{
string UniType = "Movement_Camera";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
cameraobj.AddComponent(UnityType);
cameraobj.GetComponent(UnityType).SendMessage("Set_CameraTarget", playerobj);
cameraobj.GetComponent(UnityType).SendMessage("Set_OffSet", new Vector3(0, 3, -10));
}
}
void CreateObjects_2D_VisualNovel(GameObject playerobj, GameObject groundobj)
{
DestroyImmediate(playerobj);
DestroyImmediate(groundobj);
//Create DialogSystem
GameObject dialogsystemobj = new GameObject();
dialogsystemobj.name = "DialogSystem";
if (ScriptExist("DialogSystem"))
{
string UniType = "DialogSystem";
Type UnityType = Type.GetType(UniType + ", Assembly-CSharp");
dialogsystemobj.AddComponent(UnityType);
}
//Create Canvas
GameObject visualnovel_canvas = HUD_Create_Canvas();
visualnovel_canvas.name = "Canvas_VisualNovel";
//Dialogtext
GameObject visualnovel_text = HUD_Create_Text();
//Add to canvas
visualnovel_text.transform.parent = visualnovel_canvas.transform;
}
//Home > Scripts
void Menu_Scripts()
{
//Refresh
if (GUILayout.Button("Refresh"))
SearchScripts();
//Foldout Options
_ScriptOptionsFoldout = EditorGUILayout.Foldout(_ScriptOptionsFoldout, "Extra Options");
if (_ScriptOptionsFoldout)
{
//Check UpToDate
EditorGUILayout.BeginHorizontal("box");
EditorGUILayout.BeginVertical();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Check UpToDate: ", GUILayout.Width(150));
_Search_UpToDate_Toggle = EditorGUILayout.Toggle(_Search_UpToDate_Toggle);
if (_Search_UpToDate_Toggle)
{
if (GUILayout.Button("Check All", GUILayout.Width(100)))
ScriptUpToDateAll();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
if (_Search_UpToDate_Toggle)
{
EditorGUILayout.LabelField("Compare: ", GUILayout.Width(150));
_Search_Compare_Toggle = EditorGUILayout.Toggle(_Search_Compare_Toggle);
}
EditorGUILayout.EndHorizontal();
GUILayout.EndVertical();
EditorGUILayout.EndHorizontal();
//MultiSelect
EditorGUILayout.BeginHorizontal("box");
EditorGUILayout.LabelField("Multi Select: ", GUILayout.Width(150));
_Scripts_AddMultiple_Active = EditorGUILayout.Toggle(_Scripts_AddMultiple_Active);
//MultiSelect Buttons
if (_Scripts_AddMultiple_Active)
{
//Add Selected
if (GUILayout.Button("Add Selected", GUILayout.Width(100)))
for (int i = 0; i < _Scripts_AddMultiple.Length; i++)
if (_Scripts_AddMultiple[i])
AddScript(i);
//Select All
if (GUILayout.Button("Select All", GUILayout.Width(100)))
for (int i = 0; i < _Scripts_AddMultiple.Length; i++)
_Scripts_AddMultiple[i] = true;
//DeSelect
if (GUILayout.Button("DeSelect (" + _Scripts_AddMultiple_Amount.ToString() + ")", GUILayout.Width(100)))
for (int i = 0; i < _Scripts_AddMultiple.Length; i++)
_Scripts_AddMultiple[i] = false;
}
EditorGUILayout.EndHorizontal();
//Descriptions
EditorGUILayout.BeginHorizontal("box");
EditorGUILayout.LabelField("Show Descriptions: ", GUILayout.Width(150));
_ScriptDescriptionEnable = EditorGUILayout.Toggle(_ScriptDescriptionEnable);
if (_Scripts_AddMultiple_Active)
EditorGUILayout.LabelField("*Not supported with Multi Sellect");
EditorGUILayout.EndHorizontal();
}
//Search Options
_Search_Script = EditorGUILayout.TextField("Search: ", _Search_Script);
_Search_Tag = EditorGUILayout.TextField("SearchTag: ", _Search_Tag);
_ScrollPos = EditorGUILayout.BeginScrollView(_ScrollPos);
//Quickstart Scripts
string togglestring = "QuickStart" + " || Results(" + _Search_Results.ToString() + "/" + QuickStart_Scripts.Length.ToString() + ") || In Project: " + _Search_InProject_Results.ToString();
if (_Search_UpToDate_Toggle)
togglestring += " || UpToDate: (" + _Search_UpToDate_Amount.ToString() + "/" + _Search_UpToDate_Total.ToString() + ")";
if (_Scripts_AddMultiple_Active)
togglestring += " || Selected: " + _Scripts_AddMultiple_Amount.ToString();
togglestring += $" || Last Refresh:({_Search_RefreshTime})";
_Search_QuickStartScripts_Toggle = EditorGUILayout.Foldout(_Search_QuickStartScripts_Toggle, togglestring);
if (_Search_QuickStartScripts_Toggle)
{
_Search_Results = 0;
_Search_InProject_Results = 0;
for (int i = 0; i < QuickStart_Scripts.Length; i++)
{
//Scripts
if (_Search_Script == "" || QuickStart_Scripts[i].ScriptName.ToLower().Contains(_Search_Script.ToLower()))
{
if (QuickStart_Scripts[i].ScriptTag.ToLower().Contains(_Search_Tag.ToLower()) || QuickStart_Scripts[i].ScriptTag == "" || QuickStart_Scripts[i].ScriptTag == null)
{
//Update results
_Search_Results++;
//Set color
if (QuickStart_Scripts[i].Exist)
{
GUI.backgroundColor = new Color(0, 1, 0);
_Search_InProject_Results++;
}
else
{
if (_Scripts_AddMultiple_Active)
{
if (_Scripts_AddMultiple[i])
GUI.backgroundColor = new Color(0.5f, 0.7f, 0);
else
GUI.backgroundColor = new Color(1, 0, 0);
}
else
GUI.backgroundColor = new Color(1, 0, 0);
}
//Script
Rect testrect = EditorGUILayout.BeginHorizontal();
//Update Faster
Repaint();
if (Event.current.mousePosition.y >= testrect.y && Event.current.mousePosition.y <= testrect.y + testrect.height && Event.current.mousePosition.x < testrect.width - 120)
{
GUI.backgroundColor = new Color(0.2f, 0.8f, 0);
if (Event.current.type == EventType.MouseDown && Event.current.button == 0)
{
if (_Scripts_AddMultiple_Active)
_Scripts_AddMultiple[i] = !_Scripts_AddMultiple[i];
else
{
if (_ScriptDescriptionEnable)
{
if (_Scripts_ShowDescription == i)
_Scripts_ShowDescription = -1;
else
_Scripts_ShowDescription = i;
}
else
_Scripts_ShowDescription = -1;
}
}
}
EditorGUILayout.BeginHorizontal("Box");
if (Screen.width <= 325)
{
if (_Scripts_AddMultiple_Active)
EditorGUILayout.LabelField(QuickStart_Scripts[i].ScriptName + ".cs", EditorStyles.boldLabel, GUILayout.Width(Screen.width - 150));
else
EditorGUILayout.LabelField(QuickStart_Scripts[i].ScriptName + ".cs", EditorStyles.boldLabel, GUILayout.Width(Screen.width - 135));
}
else
{
float offset = 0;
if (_Scripts_AddMultiple_Active)
offset = -205;
else
offset = -190;
if (_Search_UpToDate_Toggle && !QuickStart_Scripts[i].UpToDate && _Search_UpToDate_HasChecked && QuickStart_Scripts[i].Exist)
{
if (_Search_Compare_Toggle)
offset -= 130;
else
offset -= 65;
}
if (_Scripts_AddMultiple_Active)
EditorGUILayout.LabelField(QuickStart_Scripts[i].ScriptName + ".cs", EditorStyles.boldLabel, GUILayout.Width(Screen.width + offset));
else
EditorGUILayout.LabelField(QuickStart_Scripts[i].ScriptName + ".cs", EditorStyles.boldLabel, GUILayout.Width(Screen.width + offset));
}
if (Screen.width > 325)
EditorGUILayout.LabelField(QuickStart_Scripts[i].ScriptState, EditorStyles.miniLabel, GUILayout.Width(50));
//Check if Uptodate
if (QuickStart_Scripts[i].Exist && _Search_UpToDate_HasChecked && _Search_UpToDate_Toggle)
{
if (!QuickStart_Scripts[i].UpToDate)
{
if (_Search_Compare_Toggle)
{
if (GUILayout.Button("Compare", GUILayout.Width(63)))
{
_Search_CompareID = i;
EditorWindow.GetWindow(typeof(Tool_QuickStart_CompareScripts));
}
}
EditorGUI.BeginDisabledGroup(false);
if (GUILayout.Button("Update", GUILayout.Width(60)))
ScriptUpToDate_Update(i);
EditorGUI.EndDisabledGroup();
}
}
//Select Script
if (!QuickStart_Scripts[i].Exist)
{
EditorGUI.BeginDisabledGroup(true);
if (GUILayout.Button("Select", GUILayout.Width(50)))
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(QuickStart_Scripts[i].ScriptPath);
EditorGUI.EndDisabledGroup();
}
else
{
if (GUILayout.Button("Select", GUILayout.Width(50)))
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(QuickStart_Scripts[i].ScriptPath);
}
//Add Script
EditorGUI.BeginDisabledGroup(QuickStart_Scripts[i].Exist);
if (GUILayout.Button("Add", GUILayout.Width(50)))
AddScript(i);
EditorGUI.EndDisabledGroup();
//Add Multiple
if (_Scripts_AddMultiple_Active)
{
EditorGUI.BeginDisabledGroup(QuickStart_Scripts[i].Exist);
_Scripts_AddMultiple[i] = EditorGUILayout.Toggle(_Scripts_AddMultiple[i]);
EditorGUI.EndDisabledGroup();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndHorizontal();
//Description
if (!_Scripts_AddMultiple_Active && _Scripts_ShowDescription == i)
{
GUI.backgroundColor = Color.white;
if (QuickStart_Scripts[i].ScriptDescription != "")
GUILayout.Label(QuickStart_Scripts[i].ScriptDescription, EditorStyles.helpBox);
else
GUILayout.Label("No Info", EditorStyles.helpBox);
}
}
}
//SelectAmount
_Scripts_AddMultiple_Amount = 0;
for (int j = 0; j < _Scripts_AddMultiple.Length; j++)
{
if (_Scripts_AddMultiple[j])
_Scripts_AddMultiple_Amount++;
}
}
}
GUI.backgroundColor = Color.white;
//ProjectScripts
_Search_ProjectScripts_Toggle = EditorGUILayout.Foldout(_Search_ProjectScripts_Toggle, "Project" + " || Results(" + _Search_ProjectScripts_Results.ToString() + "/" + _Search_ProjectScripts_Total.ToString() + ")");
if (_Search_ProjectScripts_Toggle)
{
_Search_ProjectScripts_Results = 0;
_Search_ProjectScripts_Total = _Project_Scripts.Length;
for (int i = 0; i < _Project_Scripts.Length; i++)
{
if (_Search_Script == "" || _Project_Scripts[i].ToLower().Contains(_Search_Script.ToLower()))
{
//Update results
_Search_ProjectScripts_Results++;
//Script
EditorGUILayout.BeginHorizontal("Box");
EditorGUILayout.LabelField(_Project_Scripts[i], EditorStyles.boldLabel);
if (GUILayout.Button("Select", GUILayout.Width(50)))
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(_Project_Scripts[i]);
EditorGUILayout.EndHorizontal();
}
}
}
EditorGUILayout.EndScrollView();
}
//Home > Scripts : Search
void ScriptStatus(string name)
{
int scriptid = 999;
for (int i = 0; i < QuickStart_Scripts.Length; i++)
{
if (name == QuickStart_Scripts[i].ScriptName)
{
scriptid = i;
continue;
}