void AdvancedSettings()
 {
     using (ShapesUI.Group) {
         GUILayout.Label("Advanced", EditorStyles.boldLabel);
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate Shaders & Materials", "Generates all shaders and materials in Shapes")))
         {
             CodegenShaders.GenerateShadersAndMaterials();
         }
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate Draw Overloads", "Regenerates all Draw.X overload functions to DrawOverloads.cs")))
         {
             CodegenDrawOverloads.GenerateDrawOverloadsScript();
         }
     }
 }
Esempio n. 2
0
    void ShaderSettings()
    {
        using (ShapesUI.Group) {
            GUILayout.Label("Shader Settings", EditorStyles.boldLabel);
            using (ShapesUI.TempLabelWidth(160)) {
                EditorGUILayout.PropertyField(FRAG_OUTPUT_V4, new GUIContent("Output precision"));
                EditorGUILayout.PropertyField(LOCAL_ANTI_ALIASING_QUALITY, new GUIContent("Local AA quality"));
                EditorGUILayout.PropertyField(QUAD_INTERPOLATION_QUALITY, new GUIContent("Quad interpolation quality"));
                EditorGUILayout.PropertyField(NOOTS_ACROSS_SCREEN, new GUIContent("Noots across screen"));
            }

            GUILayout.Space(3);
            if (ShapesUI.CenteredButton(new GUIContent("Apply shader settings", "Apply shader settings")))
            {
                ApplyShaderSettings();
            }
            GUILayout.Space(3);
        }
    }
Esempio n. 3
0
    void PrimitiveSettings()
    {
        using (ShapesUI.Group) {
            GUILayout.Label("Primitives", EditorStyles.boldLabel);
            using (new ShapesUI.AssetEditScope(ShapesAssets.Instance)) {
                if (showDetailLevels = EditorGUILayout.Foldout(showDetailLevels, new GUIContent("Detail Levels", "Configure the mesh density of each detail level preset, for every type of Shape that can make use of it")))
                {
                    using (new EditorGUI.IndentLevelScope(1)) {
                        DrawDetailLevelProperties(sphereDetail, "Sphere", TOOLTIP_DETAIL_SPHERE, min: 1, p => PrimitiveGenerator.TriangleCountIcosphere(p.intValue));
                        DrawDetailLevelProperties(torusDivsMinorMajor, "Torus", TOOLTIP_DETAIL_TORUS, min: 3, p => PrimitiveGenerator.TriangleCountTorus(p.vector2IntValue));
                        DrawDetailLevelProperties(coneDivs, "Cone", TOOLTIP_DETAIL_CONE, min: 3, p => PrimitiveGenerator.TriangleCountCone(p.intValue));
                        DrawDetailLevelProperties(cylinderDivs, "Cylinder", TOOLTIP_DETAIL_CYLINDER, min: 3, p => PrimitiveGenerator.TriangleCountCylinder(p.intValue));
                        DrawDetailLevelProperties(capsuleDivs, "Capsule", TOOLTIP_DETAIL_CAPSULE, min: 1, p => PrimitiveGenerator.TriangleCountCapsule(p.intValue));
                    }
                }

                if (showBounds = EditorGUILayout.Foldout(showBounds, new GUIContent("Bounds Sizes", ShapesConfig.TOOLTIP_BOUNDS)))
                {
                    using (new EditorGUI.IndentLevelScope(1)) {
                        EditorGUILayout.PropertyField(boundsSizeSphere, new GUIContent("Sphere"));
                        EditorGUILayout.PropertyField(boundsSizeTorus, new GUIContent("Torus"));
                        EditorGUILayout.PropertyField(boundsSizeCone, new GUIContent("Cone"));
                        EditorGUILayout.PropertyField(boundsSizeCylinder, new GUIContent("Cylinder"));
                        EditorGUILayout.PropertyField(boundsSizeCapsule, new GUIContent("Capsule"));
                        EditorGUILayout.PropertyField(boundsSizeQuad, new GUIContent("Quad"));
                        EditorGUILayout.PropertyField(boundsSizeTriangle, new GUIContent("Triangle"));
                        EditorGUILayout.PropertyField(boundsSizeCuboid, new GUIContent("Cuboid"));
                    }
                }

                GUILayout.Space(3);
                if (ShapesUI.CenteredButton(new GUIContent("Apply & regenerate primitives", "Regenerate all primitive mesh assets using the configuration above")))
                {
                    PrimitiveGenerator.Generate3DPrimitiveAssets();
                }
                GUILayout.Space(3);
            }
        }
    }
Esempio n. 4
0
 void AdvancedSettings()
 {
     using (ShapesUI.Group) {
         GUILayout.Label("Advanced", EditorStyles.boldLabel);
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate Shaders & Materials", "Generates all shaders and materials in Shapes")))
         {
             CodegenShaders.GenerateShadersAndMaterials(UnityInfo.GetCurrentRenderPipelineInUse());
         }
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate Draw Overloads", "Regenerates all Draw.X overload functions to DrawOverloads.cs")))
         {
             CodegenDrawOverloads.GenerateDrawOverloadsScript();
         }
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate Component Interfaces", "Regenerates all Shape component interfaces")))
         {
             CodegenInterfaces.Generate();
         }
         if (ShapesUI.CenteredButton(new GUIContent("Regenerate IM meta MPBs", "Regenerates all meta-material property blocks for each shape, based on their shader parameters in the core.cginc files")))
         {
             CodegenMpbs.Generate();
         }
     }
 }