Пример #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.DrawScript();
            m_setter.Clear();

            using (EditorGUILayout.VerticalScope box = new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                switch (m_sdfOperation.Type)
                {
                case SDFOperationType.Elongate:
                    m_setter.DrawVector3Setting(Labels.Elongation, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFOperationType.Onion:
                    m_setter.DrawVectorSettingX(Labels.Rounding, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingYInt(Labels.Layers, m_serializedProperties.Data, min: 0);
                    break;

                case SDFOperationType.Round:
                    m_setter.DrawVectorSettingX(Labels.Rounding, m_serializedProperties.Data, min: 0f);
                    break;
                }
            }

            m_setter.Update();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.DrawScript();
            m_setter.Clear();

            m_setter.DrawProperty(Labels.Type, m_serializedProperties.Type);
            m_setter.DrawProperty(Labels.Operation, m_serializedProperties.Operation);
            m_setter.DrawProperty(Labels.Flip, m_serializedProperties.Flip);

            using (EditorGUILayout.VerticalScope box = new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                switch (m_sdfPrimitive.Type)
                {
                case SDFPrimitiveType.Sphere:
                    m_setter.DrawVectorSettingX(Labels.Radius, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.Torus:
                    m_setter.DrawVectorSettingX(Labels.MajorRadius, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingY(Labels.MinorRadius, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.Cuboid:
                    m_setter.DrawVector3Setting(Labels.Bounds, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingW(Labels.Roundedness, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.BoxFrame:
                    m_setter.DrawVector3Setting(Labels.Bounds, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingW(Labels.Thickness, m_serializedProperties.Data, min: 0f);
                    break;
                }
            }

            m_setter.Update();
        }
Пример #3
0
        public override void OnInspectorGUI()
        {
            serializedObject.DrawScript();
            m_setter.Clear();

            m_setter.DrawProperty(Labels.Type, m_serializedProperties.Type);
            m_setter.DrawProperty(Labels.Operation, m_serializedProperties.Operation);
            m_setter.DrawProperty(Labels.Flip, m_serializedProperties.Flip);
            m_setter.DrawFloatSetting(Labels.Smoothing, m_serializedProperties.Smoothing, min: 0f);

            using (EditorGUILayout.VerticalScope box = new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                switch (m_sdfPrimitive.Type)
                {
                case SDFPrimitiveType.Sphere:
                    m_setter.DrawVectorSettingX(Labels.Radius, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.Torus:
                    m_setter.DrawVectorSettingX(Labels.MajorRadius, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingY(Labels.MinorRadius, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.Cuboid:
                    m_setter.DrawVector3Setting(Labels.Bounds, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingW(Labels.Roundedness, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.BoxFrame:
                    m_setter.DrawVector3Setting(Labels.Bounds, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingW(Labels.Thickness, m_serializedProperties.Data, min: 0f);
                    break;

                case SDFPrimitiveType.Cylinder:
                    m_setter.DrawVectorSettingX(Labels.CylinderRadius, m_serializedProperties.Data, min: 0f);
                    m_setter.DrawVectorSettingY(Labels.CylinderLength, m_serializedProperties.Data, min: 0f);
                    break;
                }
            }

            if (m_isMaterialOpen = EditorGUILayout.Foldout(m_isMaterialOpen, Labels.Material, true))
            {
                using (EditorGUILayout.VerticalScope box = new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
                {
                    using (EditorGUI.IndentLevelScope indent = new EditorGUI.IndentLevelScope())
                    {
                        m_setter.DrawProperty(Labels.MaterialType, m_serializedProperties.MaterialType);

                        if (m_sdfPrimitive.Material.Type != SDFMaterial.MaterialType.None)
                        {
                            if (m_sdfPrimitive.Material.Type == SDFMaterial.MaterialType.Texture)
                            {
                                m_setter.DrawProperty(Labels.MaterialTexture, m_serializedProperties.MaterialTexture);
                            }

                            m_setter.DrawProperty(Labels.Colour, m_serializedProperties.Colour);
                            m_setter.DrawFloatSetting(Labels.MaterialSmoothing, m_serializedProperties.MaterialSmoothing, min: 0f);
                            m_setter.DrawProperty(Labels.Emission, m_serializedProperties.Emission);
                            m_setter.DrawProperty(Labels.Metallic, m_serializedProperties.Metallic);
                            m_setter.DrawProperty(Labels.Smoothness, m_serializedProperties.Smoothness);
                            m_setter.DrawProperty(Labels.SubsurfaceColour, m_serializedProperties.SubsurfaceColour);
                            m_setter.DrawProperty(Labels.SubsurfaceScatteringPower, m_serializedProperties.SubsurfaceScatteringPower);
                        }
                    }
                }
            }

            m_setter.Update();
        }