summaryrefslogtreecommitdiff
path: root/VRCSDK3Worlds/Assets/VRWorldToolkit/Scripts/Editor/VRWTDataStructures.cs
blob: a02d61dd05a4f26173322e96b6026475c9831985 (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
using UnityEditor;
using UnityEngine;

namespace VRWorldToolkit.DataStructures
{
    public static class Styles
    {
        public static GUIStyle HelpBoxRichText { get; internal set; }
        public static GUIStyle HelpBoxPadded { get; internal set; }
        public static GUIStyle LabelRichText { get; internal set; }
        public static GUIStyle RichText { get; internal set; }
        public static GUIStyle RichTextWrap { get; internal set; }
        public static GUIStyle BoldWrap { get; internal set; }
        public static GUIStyle RedLabel { get; internal set; }
        public static GUIStyle TreeViewLabel { get; internal set; }
        public static GUIStyle TreeViewLabelSelected { get; internal set; }
        public static GUIStyle CenteredLabel { get; internal set; }
        public static GUIStyle Center { get; internal set; }

        static Styles()
        {
            Reload();
        }

        static void Reload()
        {
            HelpBoxRichText = new GUIStyle("HelpBox")
            {
                alignment = TextAnchor.MiddleLeft,
                richText = true
            };

            HelpBoxPadded = new GUIStyle("HelpBox")
            {
                margin = new RectOffset(18, 4, 4, 4),
                alignment = TextAnchor.MiddleLeft,
                richText = true
            };

            LabelRichText = new GUIStyle("Label")
            {
                richText = true,
                margin = new RectOffset(5, 5, 0, 0),
            };

            RichText = new GUIStyle
            {
                richText = true
            };

            RichTextWrap = new GUIStyle("Label")
            {
                richText = true,
                wordWrap = true
            };

            BoldWrap = new GUIStyle("boldLabel")
            {
                wordWrap = true
            };

            RedLabel = new GUIStyle("Label")
            {
                normal =
                {
                    textColor = Color.red,
                },
            };

            TreeViewLabel = new GUIStyle("Label")
            {
                alignment = TextAnchor.MiddleLeft,
                wordWrap = false,
            };

            TreeViewLabelSelected = new GUIStyle("WhiteLabel")
            {
                alignment = TextAnchor.MiddleLeft,
                wordWrap = false,
            };

            CenteredLabel = new GUIStyle("Label")
            {
                alignment = TextAnchor.LowerCenter,
                fontSize = 17,
                fontStyle = FontStyle.BoldAndItalic,
                normal =
                {
                    textColor = new Color(0.33f, 0.33f, 0.33f),
                }
            };

            Center = new GUIStyle()
            {
                alignment = TextAnchor.MiddleCenter
            };
        }
    }

    public static class Validation
    {
        /// <summary>
        /// Sourced from the whitelist included in the VRCSDK
        /// https://docs.vrchat.com/docs/quest-content-limitations
        /// </summary>
        public static readonly string[] WorldShaderWhiteList =
        {
            "VRChat/Mobile/Standard Lite",
            "VRChat/Mobile/Diffuse",
            "VRChat/Mobile/Bumped Diffuse",
            "VRChat/Mobile/Bumped Mapped Specular",
            "VRChat/Mobile/Toon Lit",
            "VRChat/Mobile/MatCap Lit",
            "VRChat/Mobile/Lightmapped",
            "VRChat/Mobile/Skybox",
            "VRChat/Mobile/Particles/Additive",
            "VRChat/Mobile/Particles/Multiply",
            "FX/MirrorReflection",
            "UI/Default"
        };

        /// <summary>
        /// Sourced from Unity documentation at:
        /// https://docs.unity3d.com/2018.4/Documentation/Manual/class-TextureImporterOverride.html
        /// </summary>
        public static readonly TextureImporterFormat[] UnsupportedCompressionFormatsQuest =
        {
            TextureImporterFormat.DXT1,
            TextureImporterFormat.DXT5,
            TextureImporterFormat.DXT1Crunched,
            TextureImporterFormat.DXT5Crunched,
            TextureImporterFormat.BC6H,
            TextureImporterFormat.BC7,
            TextureImporterFormat.PVRTC_RGB2,
            TextureImporterFormat.PVRTC_RGB4,
            TextureImporterFormat.PVRTC_RGBA2,
            TextureImporterFormat.PVRTC_RGBA4,
        };
    }
}