Skip to content

Commit 4d58631

Browse files
committedMar 4, 2024
Update About window
1 parent c2af15c commit 4d58631

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed
 

‎Editor/About.cs

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using UnityEditor;
1+
using System;
2+
using UnityEditor;
23
using UnityEngine;
34

45
namespace VRWorldToolkit.Editor
56
{
6-
public class VRWTAbout : EditorWindow
7+
public class About : EditorWindow
78
{
89
[MenuItem("VRWorld Toolkit/About VRWorld Toolkit", false, 40)]
910
public static void ShowWindow()
1011
{
11-
var window = (VRWTAbout) GetWindow(typeof(VRWTAbout), true, "VRWorld Toolkit");
12+
var window = (About) GetWindow(typeof(About), true, "VRWorld Toolkit");
1213
window.minSize = new Vector2(600, 380);
1314
window.maxSize = new Vector2(600, 380);
1415
window.Show();
@@ -18,6 +19,8 @@ public static void ShowWindow()
1819

1920
private static Texture iconTwitter, iconDiscord, iconGithub;
2021

22+
[NonSerialized] private int clickCounter;
23+
2124
public void OnEnable()
2225
{
2326
header = new GUIStyle
@@ -30,12 +33,6 @@ public void OnEnable()
3033
fixedHeight = 140
3134
};
3235

33-
text = new GUIStyle("Label")
34-
{
35-
wordWrap = true,
36-
richText = true
37-
};
38-
3936
iconTwitter = Resources.Load("VRWorldToolkit/SplashTextures/IconTwitter") as Texture2D;
4037
iconDiscord = Resources.Load("VRWorldToolkit/SplashTextures/IconDiscord") as Texture2D;
4138
iconGithub = Resources.Load("VRWorldToolkit/SplashTextures/IconGithub") as Texture2D;
@@ -44,14 +41,26 @@ public void OnEnable()
4441
private void OnGUI()
4542
{
4643
// Header Image
47-
GUILayout.Box("", header);
44+
if (GUILayout.Button("", header))
45+
{
46+
clickCounter++;
47+
if (clickCounter >= 10)
48+
{
49+
Debug.Log("Toggled benchmark mode for VRWorld Toolkit");
50+
#if VRWT_BENCHMARK
51+
ScriptingDefineManager.RemoveScriptingDefine("VRWT_BENCHMARK");
52+
#else
53+
ScriptingDefineManager.AddScriptingDefine("VRWT_BENCHMARK");
54+
#endif
55+
}
56+
};
4857

4958
// Information Texts
5059
GUILayout.Label("Welcome to VRWorld Toolkit!", EditorStyles.boldLabel);
5160

52-
GUILayout.Label("VRWorld Toolkit is a project aimed at helping people get into world building faster without spending time combing different documentations for all the smaller mistakes you can make while making your first world. Even for experienced world builders, it helps make tedious steps like setting up post-processing faster and allows you not to forget the dozen little things you need to remember while building worlds.", text);
61+
GUILayout.Label("VRWorld Toolkit is a project aimed at helping people get into world building faster without spending time combing different documentations for all the smaller mistakes you can make while making your first world. Even for experienced world builders, it helps make tedious steps like setting up post-processing faster and allows you not to forget the dozen little things you need to remember while building worlds.", Styles.RichTextWrap);
5362

54-
GUILayout.Label("If you have suggestions, found problems with the included tools, or want to check my social channels, you can click on the buttons below. Feedback is always welcome, so I know what to improve!", text);
63+
GUILayout.Label("If you have suggestions, found problems with the included tools, or want to check my social channels, you can click on the buttons below. Feedback is always welcome, so I know what to improve!", Styles.RichTextWrap);
5564

5665
GUILayout.FlexibleSpace();
5766

0 commit comments

Comments
 (0)
Please sign in to comment.