summaryrefslogtreecommitdiff
path: root/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/VRC_SdkSplashScreen.cs
blob: 8f80c939630c9d1ccd1f24703c79c3f2350ad84a (plain)
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
#define COMMUNITY_LABS_SDK

using UnityEngine;
using UnityEditor;

namespace VRCSDK2
{
    [InitializeOnLoad]
    public class VRC_SdkSplashScreen : EditorWindow
    {

        static VRC_SdkSplashScreen()
        {
            EditorApplication.update -= DoSplashScreen;
            EditorApplication.update += DoSplashScreen;
        }

        private static void DoSplashScreen()
        {
            EditorApplication.update -= DoSplashScreen;
            if (EditorApplication.isPlaying)
                return;

            #if UDON
                if (!EditorPrefs.GetBool("VRCSDK_ShowedSplashScreenFirstTime", false))
                {
                    OpenSplashScreen();
                    EditorPrefs.SetBool("VRCSDK_ShowedSplashScreenFirstTime", true);
                }
                else
            #endif
                if (EditorPrefs.GetBool("VRCSDK_ShowSplashScreen", true))
                    OpenSplashScreen();
        }

        private static GUIStyle vrcSdkHeader;
        private static GUIStyle vrcSdkBottomHeader;
        private static GUIStyle vrcHeaderLearnMoreButton;
        private static GUIStyle vrcBottomHeaderLearnMoreButton;
        private static Vector2 changeLogScroll;
        [MenuItem("VRChat SDK/Splash Screen", false, 500)]
        public static void OpenSplashScreen()
        {
            GetWindow<VRC_SdkSplashScreen>(true);
        }
        
        public static void Open()
        {
            OpenSplashScreen();
        }

        public void OnEnable()
        {
            titleContent = new GUIContent("VRChat SDK");

#if UDON
            maxSize = new Vector2(400, 360);
#else
            maxSize = new Vector2(400, 600);
#endif
            minSize = maxSize;

            vrcSdkHeader = new GUIStyle
            {
                normal =
                    {
#if UDON
                            background = Resources.Load("vrcSdkSplashUdon1") as Texture2D,
#elif COMMUNITY_LABS_SDK
                            background = Resources.Load("vrcSdkHeaderWithCommunityLabs") as Texture2D,
#else
                            background = Resources.Load("vrcSdkHeader") as Texture2D,
#endif
                        textColor = Color.white
                    },
                fixedHeight = 200
            };

            vrcSdkBottomHeader = new GUIStyle
            {
                normal =
                {
#if UDON
                        background = Resources.Load("vrcSdkSplashUdon2") as Texture2D,
#else
                        background = Resources.Load("vrcSdkBottomHeader") as Texture2D,
#endif

                    textColor = Color.white
                },
                fixedHeight = 100
            };

        }

        public void OnGUI()
        {
            GUILayout.Box("", vrcSdkHeader);

                vrcHeaderLearnMoreButton = EditorStyles.miniButton;
                vrcHeaderLearnMoreButton.normal.textColor = Color.black;
                vrcHeaderLearnMoreButton.fontSize = 12;
                vrcHeaderLearnMoreButton.border = new RectOffset(10, 10, 10, 10);
                Texture2D texture = UnityEditor.AssetDatabase.GetBuiltinExtraResource<Texture2D>("UI/Skin/UISprite.psd");
                vrcHeaderLearnMoreButton.normal.background = texture;
                vrcHeaderLearnMoreButton.active.background = texture;
#if UDON
            if (GUI.Button(new Rect(20, 165, 185, 25), "Get Started with Udon", vrcHeaderLearnMoreButton))
                    Application.OpenURL("https://docs.vrchat.com/docs/getting-started-with-udon");
#elif COMMUNITY_LABS_SDK
            if (GUI.Button(new Rect(20, 140, 180, 40), "Please Read", vrcHeaderLearnMoreButton))
                    Application.OpenURL(CommunityLabsConstants.COMMUNITY_LABS_DOCUMENTATION_URL);
#endif

#if !UDON
            GUILayout.Space(4);
            GUILayout.BeginHorizontal();
            GUI.backgroundColor = Color.gray;
            if (GUILayout.Button("SDK Docs"))
            {
                Application.OpenURL("https://docs.vrchat.com/");
            }
            if (GUILayout.Button("VRChat FAQ"))
            {
                Application.OpenURL("https://vrchat.com/developer-faq");
            }
            if (GUILayout.Button("Help Center"))
            {
                Application.OpenURL("http://help.vrchat.com");
            }
            if(GUILayout.Button("Examples"))
            {
                Application.OpenURL("https://docs.vrchat.com/docs/vrchat-kits");
            }
            GUI.backgroundColor = Color.white;
            GUILayout.EndHorizontal();
#endif
            GUILayout.Space(4);
            GUILayout.BeginHorizontal();
            
            GUI.backgroundColor = Color.gray;
#if UDON

            if(GUILayout.Button("Udon Examples"))
            {
                Application.OpenURL("https://docs.vrchat.com/docs/examples#udon--sdk3");
            };
#endif
            if (GUILayout.Button("Building VRChat Quest Content"))
            {
                Application.OpenURL("https://docs.vrchat.com/docs/creating-content-for-the-oculus-quest");
            }
            GUI.backgroundColor = Color.white;
            GUILayout.EndHorizontal();
            GUILayout.Space(2);
#if !UDON
            changeLogScroll = GUILayout.BeginScrollView(changeLogScroll, false, false, GUIStyle.none, GUI.skin.verticalScrollbar, GUILayout.Width(395));

            GUILayout.Label(
                @"Changelog:
2019.2.4-SDK1
- Removed upload-preventing polygon limits for avatars in SDK.
- This does not change behavior in the client. Although
you can upload content that goes beyond client limits 
(for example, the Quest polygon limit), it will not render
in VRChat according to the Minimum Performance Rank setting

2019.2.4
- Implemented Quest Avatar limits. If your avatar is
ranked as Very Poor, you will not be able to upload
the avatar.
- If you do upload an avatar beyond the Very Poor
limits, it will not render in VRChat Quest regardless

2019.2.3
- Added a VRChat/Mobile/Standard Lite for use on
Oculus Quest avatars
- Standard Lite offers slots for Diffuse, Normal maps,
Metallic+Smoothness maps, and optional Emission maps
- Standard Lite uses a simplified version of BRDF for
lighting

2019.2.2
- Added links to the splash screen leading users to our
Quest documentation
- Added Quest shaders to SDK, available under the VRChat
category
- Quest will only support these shaders on avatars. If 
you use any other shader, you'll get a warning in the
SDK. If you try to use the shader anyways, it will
fail to load in the client. You can read more about
these shaders in our documentation
- Added warnings when attempting to use unsupported
shaders on Quest
- Added errors when you attempt to upload content
too large for Quest (50mb for worlds, 10mb for
avatars). Build size is determined after package is
created. This will also be enforced in-client for Quest

2019.1.4p2
- Fixed an issue causing redundant error messaging when 
informing the user that there are objects that share the 
same path

2019.1.4
- Some additional tooltips in VRC_Mirror inspector for 
clarity
- Added a field for a custom shader on mirrors, allowing 
the mirror shader to be overridden without the need to 
swap materials 
using an animator
- Added a drop-down option for mirrors allowing for the 
setting of lower fixed resolutions

2019.1.3
- Implemented features to enable usage of Community Labs
    - Added Community Labs checkbox in the Publish World
screen
- Publishing a world no longer changes its release status.
If you update a Public World, it now remains public
- Changed and updated SDK UI in some places
- Mirrors should now display properly in the editor as 
we've moved the necessary shader into place

2019.1.1
- Content Manager now behaves better when resizing 
the window and scales the contents appropriately"
            );
            GUILayout.EndScrollView();
#endif
            GUILayout.Space(4);

            GUILayout.Box("", vrcSdkBottomHeader);
            vrcBottomHeaderLearnMoreButton = EditorStyles.miniButton;
            vrcBottomHeaderLearnMoreButton.normal.textColor = Color.black;
            vrcBottomHeaderLearnMoreButton.fontSize = 10;
            vrcBottomHeaderLearnMoreButton.border = new RectOffset(10, 10, 10, 10);
            vrcBottomHeaderLearnMoreButton.normal.background = texture;
            vrcBottomHeaderLearnMoreButton.active.background = texture;

#if UDON
            if (GUI.Button(new Rect(100, 270, 200, 60), "Join other Creators in our Discord", vrcBottomHeaderLearnMoreButton))
                Application.OpenURL("https://discord.gg/vrchat");
#else
            if (GUI.Button(new Rect(110, 525, 180, 42), "Click Here to see great\nassets for VRChat creation", vrcBottomHeaderLearnMoreButton))
                Application.OpenURL("https://assetstore.unity.com/lists/vrchat-picks-125734?aid=1101l7yuQ");
#endif

            //if (GUI.Button(new Rect(80, 540, 240, 30), "Learn how to create for VRChat Quest!", vrcBottomHeaderLearnMoreButton))
            //{
            //    Application.OpenURL("https://docs.vrchat.com/docs/creating-content-for-the-oculus-quest");
            //}

            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();

            GUILayout.FlexibleSpace();
            EditorPrefs.SetBool("VRCSDK_ShowSplashScreen", GUILayout.Toggle(EditorPrefs.GetBool("VRCSDK_ShowSplashScreen"), "Show at Startup"));

            GUILayout.EndHorizontal();
        }

    }
}