コード例 #1
0
        static void PreferencesGUI()
        {
            EditorGUILayout.BeginVertical();
            EditorGUILayout.Space();

            // Show EditorVR GameObjects
            {
                string title   = "Show EditorVR GameObjects";
                string tooltip = "Normally, EditorVR GameObjects are hidden in the Hierarchy. Would you like to show them?";

                EditorGUI.BeginChangeCheck();
                showGameObjects = EditorGUILayout.Toggle(new GUIContent(title, tooltip), showGameObjects);
                if (EditorGUI.EndChangeCheck() && s_Instance)
                {
                    s_Instance.SetHideFlags(defaultHideFlags);
                }
            }

            // Preserve Layout
            {
                string title   = "Preserve Layout";
                string tooltip = "Check this to preserve your layout and location in EditorVR";
                preserveLayout = EditorGUILayout.Toggle(new GUIContent(title, tooltip), preserveLayout);
            }

            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Reset to Defaults", GUILayout.Width(140)))
            {
                ResetPreferences();
            }

            EditorGUILayout.EndVertical();
        }
コード例 #2
0
        static void PreferencesGUI()
        {
            EditorGUILayout.BeginVertical();

            // Show EditorXR GameObjects
            {
                const string title   = "Show EditorXR GameObjects";
                const string tooltip = "Normally, EditorXR GameObjects are hidden in the Hierarchy. Would you like to show them?";

                EditorGUI.BeginChangeCheck();
                EditorVR.showGameObjects = EditorGUILayout.Toggle(new GUIContent(title, tooltip), EditorVR.showGameObjects);
                if (EditorGUI.EndChangeCheck() && s_Instance)
                {
                    s_Instance.SetHideFlags(EditorVR.defaultHideFlags);
                }
            }

            // Preserve Layout
            {
                const string title   = "Preserve Layout";
                const string tooltip = "Check this to preserve your layout and location in EditorXR";
                EditorVR.preserveLayout = EditorGUILayout.Toggle(new GUIContent(title, tooltip), EditorVR.preserveLayout);
            }

            // Include in Builds
            {
                const string title   = "Include in Player Builds";
                const string tooltip = "Normally, EditorXR will override its assembly definitions to keep its assemblies out of Player builds. Check this if you would like to skip this step and include EditorXR in Player builds";
                EditorVR.includeInBuilds = EditorGUILayout.Toggle(new GUIContent(title, tooltip), EditorVR.includeInBuilds);
            }

            if (GUILayout.Button("Reset to Defaults", GUILayout.Width(140)))
            {
                EditorVR.ResetPreferences();
            }

            EditorGUILayout.EndVertical();
        }