Example #1
0
 private void DrawMaps()
 {
     using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
     {
         GUILayout.Space(-5f);
         m_SurfaceOptionsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_SurfaceOptionsFoldout, new GUIContent("Main Maps"));
         if (m_SurfaceOptionsFoldout)
         {
             EditorGUI.indentLevel++;
             //materialEditor.TexturePropertySingleLine(new GUIContent("Texture (A=Alpha)"), baseMap, color);
             materialEditor.TextureProperty(baseMap, "Texture (A=Alpha)");
             //materialEditor.ShaderProperty(baseMap, new GUIContent("Texture (A=Alpha)"));
             materialEditor.ShaderProperty(alphaCutoffProp, "Alpha clipping");
             materialEditor.TextureProperty(bumpMap, "Normal map");
             EditorGUI.indentLevel--;
         }
         EditorGUILayout.EndFoldoutHeaderGroup();
     }
 }
Example #2
0
        public void ShaderPropertiesGUI(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            EditorGUI.BeginChangeCheck();

            m_SurfaceOptionsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_SurfaceOptionsFoldout, Styles.SurfaceOptions);
            if (m_SurfaceOptionsFoldout)
            {
                DrawSurfaceOptions(material);
                EditorGUILayout.Space();
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            // m_SurfaceInputsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_SurfaceInputsFoldout, Styles.SurfaceInputs);
            // if (m_SurfaceInputsFoldout)
            // {
            //     DrawSurfaceInputs(material);
            //     EditorGUILayout.Space();
            // }
            // EditorGUILayout.EndFoldoutHeaderGroup();

            // m_AdvancedFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_AdvancedFoldout, Styles.AdvancedLabel);
            // if (m_AdvancedFoldout)
            // {
            //     DrawAdvancedOptions(material);
            //     EditorGUILayout.Space();
            // }
            // EditorGUILayout.EndFoldoutHeaderGroup();

            // DrawAdditionalFoldouts(material);

            if (EditorGUI.EndChangeCheck())
            {
                foreach (var obj in  materialEditor.targets)
                {
                    MaterialChanged((Material)obj);
                }
            }
        }
Example #3
0
 void DrawGeneralSettings()
 {
     m_GeneralSettingsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_GeneralSettingsFoldout, Styles.generalSettingsText);
     if (m_GeneralSettingsFoldout)
     {
         EditorGUI.indentLevel++;
         EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTextureText);
         EditorGUILayout.PropertyField(m_RequireOpaqueTextureProp, Styles.requireOpaqueTextureText);
         EditorGUI.indentLevel++;
         EditorGUI.BeginDisabledGroup(!m_RequireOpaqueTextureProp.boolValue);
         EditorGUILayout.PropertyField(m_OpaqueDownsamplingProp, Styles.opaqueDownsamplingText);
         EditorGUI.EndDisabledGroup();
         EditorGUI.indentLevel--;
         EditorGUI.indentLevel--;
         EditorGUILayout.Space();
         EditorGUILayout.Space();
     }
     EditorGUILayout.EndFoldoutHeaderGroup();
 }
Example #4
0
        public virtual void OnInspectorGUI(bool calledByBase = true)
        {
            EditorGUILayout.BeginHorizontal();
            foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, Path.GetFileName(MenuPath()));
            fac     = GUILayout.HorizontalSlider(fac, .0f, 1.0f);

            string showBtn = show ? "Hide" : "Show";

            if (GUILayout.Button(showBtn, GUILayout.ExpandWidth(false)))
            {
                show = !show;
            }

            if (calledByBase)
            {
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndFoldoutHeaderGroup();
            }
        }
        private void DrawMaterialProps(MaterialEditor editor, Material mat)
        {
            {
                var texStates = EditorGUILayout.BeginFoldoutHeaderGroup(GetToggleState("TexGroups"), Styles.MainPropsHeaderContent);
                if (texStates)
                {
                    editor.TexturePropertyWithHDRColor(Styles.AlbdeoTexContent, albedoTex, albedoColor, true);
                    editor.TexturePropertyWithHDRColor(Styles.EmissiveTexContent, emissiveTex, emissiveColor, false);
                    editor.TextureScaleOffsetProperty(texOffset);

                    if (emissiveTex.textureValue == null)
                    {
                        mat.DisableKeyword("EMISSION_ON");
                    }
                    else
                    {
                        mat.EnableKeyword("EMISSION_ON");
                    }
                }
                SetToggleState("TexGroups", texStates);
                EditorGUILayout.EndFoldoutHeaderGroup();
            }

            {
                var reflState = EditorGUILayout.BeginFoldoutHeaderGroup(GetToggleState("Refl"), Styles.ReflPropsHeaderContent);
                if (reflState)
                {
                    var s = mat.IsKeywordEnabled("REFLECTIONS_ON");
                    s = EditorGUILayout.Toggle(Styles.ReflectionsContent, s);
                    if (s)
                    {
                        mat.EnableKeyword("REFLECTIONS_ON");
                        DrawReflectionProps(editor, mat);
                    }
                    else
                    {
                        mat.DisableKeyword("REFLECTIONS_ON");
                    }
                }
                SetToggleState("Refl", reflState);
                EditorGUILayout.EndFoldoutHeaderGroup();
            }
        }
Example #6
0
        void DrawGeneralSettings()
        {
            m_GeneralSettingsFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(m_GeneralSettingsFoldout.value, Styles.generalSettingsText);
            if (m_GeneralSettingsFoldout.value)
            {
                EditorGUI.indentLevel++;

                EditorGUILayout.Space();
                EditorGUI.indentLevel--;
                m_RendererDataList.DoLayoutList();
                EditorGUI.indentLevel++;

                UniversalRenderPipelineAsset asset = target as UniversalRenderPipelineAsset;
                string unsupportedGraphicsApisMessage;

                if (!asset.ValidateRendererData(-1))
                {
                    EditorGUILayout.HelpBox(Styles.rendererMissingDefaultMessage.text, MessageType.Error, true);
                }
                else if (!asset.ValidateRendererDataList(true))
                {
                    EditorGUILayout.HelpBox(Styles.rendererMissingMessage.text, MessageType.Warning, true);
                }
                else if (!ValidateRendererGraphicsAPIs(asset, out unsupportedGraphicsApisMessage))
                {
                    EditorGUILayout.HelpBox(Styles.rendererUnsupportedAPIMessage.text + unsupportedGraphicsApisMessage, MessageType.Warning, true);
                }

                EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTextureText);
                EditorGUILayout.PropertyField(m_RequireOpaqueTextureProp, Styles.requireOpaqueTextureText);
                EditorGUI.indentLevel++;
                EditorGUI.BeginDisabledGroup(!m_RequireOpaqueTextureProp.boolValue);
                EditorGUILayout.PropertyField(m_OpaqueDownsamplingProp, Styles.opaqueDownsamplingText);
                EditorGUI.EndDisabledGroup();
                EditorGUI.indentLevel--;
                EditorGUILayout.PropertyField(m_SupportsTerrainHolesProp, Styles.supportsTerrainHolesText);
                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
                EditorGUILayout.Space();
            }

            EditorGUILayout.EndFoldoutHeaderGroup();
        }
    public override void OnInspectorGUI()
    {
        // Declare help text
        string helpText = @"This 3D Character Controller uses a Rigidbody and the physics system to move about. As such, it will require a Rigidbody component to function properly. 

Reasonable default values have been given for most field under default physics settings to give you an idea of where you should expect them to be.";

        // Display help text
        showText = EditorGUILayout.BeginFoldoutHeaderGroup(showText, "Info");
        if (showText)
        {
            EditorGUILayout.HelpBox(helpText, MessageType.Info);
        }

        EditorGUILayout.EndFoldoutHeaderGroup();

        // Display base inspector gui
        base.OnInspectorGUI();
    }
        private void ShowComponent(SerializedProperty comp)
        {
            // var isSerializer =
            //     comp.FindPropertyRelative(nameof(GhostAuthoringComponent.GhostComponentInfo.isSerializer));
            //
            // if (isSerializer.boolValue)
            // {
            //     return;
            // }

            var fieldName          = comp.FindPropertyRelative(nameof(GhostAuthoringComponent.GhostComponentInfo.name));
            var server             = comp.FindPropertyRelative(nameof(GhostAuthoringComponent.GhostComponentInfo.server));
            var interpolatedClient =
                comp.FindPropertyRelative(nameof(GhostAuthoringComponent.GhostComponentInfo.interpolatedClient));
            var predictedClient =
                comp.FindPropertyRelative(nameof(GhostAuthoringComponent.GhostComponentInfo.predictedClient));

            GUIStyle style = null;

            style           = new GUIStyle(EditorStyles.foldoutHeader);
            style.fontStyle = FontStyle.Normal;


            string title = System.String.Format("{0}{1} ({2}/{3}/{4})",
                                                "",
                                                fieldName.stringValue,
                                                server.boolValue ? "S" : "-",
                                                interpolatedClient.boolValue ? "IC" : "-",
                                                predictedClient.boolValue ? "PC" : "-");

            comp.isExpanded = EditorGUILayout.BeginFoldoutHeaderGroup(comp.isExpanded, title, style);
            if (comp.isExpanded)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(server);
                EditorGUILayout.PropertyField(interpolatedClient);
                EditorGUILayout.PropertyField(predictedClient);
                --EditorGUI.indentLevel;
            }

            EditorGUILayout.EndFoldoutHeaderGroup();
        }
        void DrawShadowSettings()
        {
            m_ShadowSettingsFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(m_ShadowSettingsFoldout.value, Styles.shadowSettingsText);
            if (m_ShadowSettingsFoldout.value)
            {
                EditorGUI.indentLevel++;
                m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f, EditorGUILayout.FloatField(Styles.shadowDistanceText, m_ShadowDistanceProp.floatValue));
                EditorUtils.Unit unit = EditorUtils.Unit.Metric;
                if (m_ShadowCascadeCountProp.intValue != 0)
                {
                    EditorGUI.BeginChangeCheck();
                    unit = (EditorUtils.Unit)EditorGUILayout.EnumPopup(EditorGUIUtility.TrTextContent("Working Unit", "Except Max Distance which will be still in meter."), m_State.value);
                    if (EditorGUI.EndChangeCheck())
                    {
                        m_State.value = unit;
                    }
                }

                EditorGUILayout.IntSlider(m_ShadowCascadeCountProp, UniversalRenderPipelineAsset.k_ShadowCascadeMinCount, UniversalRenderPipelineAsset.k_ShadowCascadeMaxCount, Styles.shadowCascadesText);

                int cascadeCount = m_ShadowCascadeCountProp.intValue;
                EditorGUI.indentLevel++;

                bool  useMetric         = unit == EditorUtils.Unit.Metric;
                float baseMetric        = m_ShadowDistanceProp.floatValue;
                int   cascadeSplitCount = cascadeCount - 1;

                DrawCascadeSliders(cascadeSplitCount, useMetric, baseMetric);

                EditorGUI.indentLevel--;
                DrawCascades(cascadeCount, useMetric, baseMetric);
                EditorGUI.indentLevel++;

                m_ShadowDepthBiasProp.floatValue  = EditorGUILayout.Slider(Styles.shadowDepthBias, m_ShadowDepthBiasProp.floatValue, 0.0f, UniversalRenderPipeline.maxShadowBias);
                m_ShadowNormalBiasProp.floatValue = EditorGUILayout.Slider(Styles.shadowNormalBias, m_ShadowNormalBiasProp.floatValue, 0.0f, UniversalRenderPipeline.maxShadowBias);
                EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
                EditorGUILayout.Space();
            }
            EditorGUILayout.EndFoldoutHeaderGroup();
        }
Example #10
0
        private void DrawRendering()
        {
            using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                GUILayout.Space(-5f);
                m_RenderingOptionsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_RenderingOptionsFoldout, new GUIContent("Rendering"));
                if (m_RenderingOptionsFoldout)
                {
                    EditorGUI.indentLevel++;
                    var cullingMode = (int)culling.floatValue;

                    cullingMode = EditorGUILayout.Popup("Culling", cullingMode, new string[] { "Double-sided", "Front-faces", "Back-faces" });

                    culling.floatValue = cullingMode;
                    materialEditor.ShaderProperty(disableShadows, "Receive Shadows");
                    if (disableShadows.floatValue == 1)
                    {
                        EditorGUI.indentLevel++;
                        materialEditor.ShaderProperty(shadowBiasCorrection, new GUIContent("Shadow banding correction", "Offsets the shadows received by the grass a tiny bit. This avoids unwanted self-shadowing (aka shadow acne)\n\nHas the added benefit of creating fake contact shadows."));
                        EditorGUI.indentLevel--;
                    }
                    materialEditor.ShaderProperty(alphaToCoverage, new GUIContent("Alpha to coverage", "Reduces aliasing when using MSAA"));
                    if (alphaToCoverage.floatValue > 0 && UniversalRenderPipeline.asset.msaaSampleCount == 1)
                    {
                        EditorGUILayout.HelpBox("MSAA is disabled, alpha to coverage will have no effect", MessageType.None);
                    }

                    enableDistFade = EditorGUILayout.Toggle(new GUIContent("Distance fading", "Reduces the alpha clipping based on camera distance." +
                                                                           "\n\nNote that this does not improve performance, only pixels are being hidden, meshes are still being rendered, " +
                                                                           "best to match these settings to your maximum grass draw distance"), enableDistFade);
                    if (enableDistFade)
                    {
                        EditorGUI.indentLevel++;
                        DrawMinMaxSlider("Start/End", ref fadeStartDist, ref fadeEndDist);
                        EditorGUI.indentLevel--;
                    }

                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }
        }
    private void DrawTools()
    {
        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
        toolsBuildHeader = EditorGUILayout.BeginFoldoutHeaderGroup(toolsBuildHeader, "Build");
        if (toolsBuildHeader)
        {
            DrawBuildSettings();
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
        toolsSettingsHeader = EditorGUILayout.BeginFoldoutHeaderGroup(toolsSettingsHeader, "Benchmark Settings");
        if (toolsSettingsHeader)
        {
            DrawBenchmarkSettings();
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
        EditorGUILayout.EndVertical();
    }
        void DrawModules()
        {
            openMdules = EditorGUILayout.BeginFoldoutHeaderGroup(openMdules, "Modules");

            if (openMdules)
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);

                foreach (string propertyName in modulesFlagNames)
                {
                    SerializedProperty property = serializedObject.FindProperty(propertyName);
                    EditorGUILayout.PropertyField(property);
                    serializedObject.ApplyModifiedProperties();
                }

                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.EndFoldoutHeaderGroup();
        }
Example #13
0
    private void DrawToonSpecularOptions(Material material, MaterialEditor materialEditor)
    {
        this.toonSpecularOptionsFoldout.SetValue(EditorGUILayout.BeginFoldoutHeaderGroup(this.toonSpecularOptionsFoldout.GetValue(), "Toon Specular Options"));
        if (this.toonSpecularOptionsFoldout.GetValue())
        {
            materialEditor.TexturePropertySingleLine(ToonShaderEditorStatic.SpecularRampText, this.SpecularRamp);
            if (material.IsKeywordEnabled(ToonShaderEditorStatic.TOON_SPECULAR_ENABLED))
            {
                EditorGUI.indentLevel += 1;
                materialEditor.TexturePropertySingleLine(ToonShaderEditorStatic.SpecularMapText, this.SpecularMap);
                materialEditor.FloatProperty(this.SpecularPower, ToonShaderEditorStatic.SpecularPowerText);
                materialEditor.ColorProperty(this.SpecularColor, ToonShaderEditorStatic.SpecularColorText);
                EditorGUI.indentLevel -= 1;
            }

            EditorGUILayout.Space();
        }

        EditorGUILayout.EndFoldoutHeaderGroup();
    }
Example #14
0
    private void DrawToonRimOptions(Material material, MaterialEditor materialEditor)
    {
        this.toonRimOptionsFoldout.SetValue(EditorGUILayout.BeginFoldoutHeaderGroup(this.toonRimOptionsFoldout.GetValue(), "Toon Rim Options"));
        if (this.toonRimOptionsFoldout.GetValue())
        {
            materialEditor.RangeProperty(this.RimPower, ToonShaderEditorStatic.RimPowerText);
            if (material.IsKeywordEnabled(ToonShaderEditorStatic.RIM_LIGHTNING_ENABLED))
            {
                EditorGUI.indentLevel += 1;
                materialEditor.FloatProperty(this.RimOffset, ToonShaderEditorStatic.RomOffsetText);
                materialEditor.TexturePropertySingleLine(ToonShaderEditorStatic.RimMapText, this.RimMap);
                materialEditor.ColorProperty(this.RimColor, ToonShaderEditorStatic.RimColorText);
                EditorGUI.indentLevel -= 1;
            }

            EditorGUILayout.Space();
        }

        EditorGUILayout.EndFoldoutHeaderGroup();
    }
    public override void OnInspectorGUI()
    {
        // Get reference to script
        PursueTargetBehaviour script = target as PursueTargetBehaviour;

        // Declare help text
        string infoText = "This object serves as a container for audio files";

        // Display help text
        _showText = EditorGUILayout.BeginFoldoutHeaderGroup(_showText, "Info");
        if (_showText)
        {
            EditorGUILayout.HelpBox(infoText, MessageType.Info);
        }

        EditorGUILayout.EndFoldoutHeaderGroup();

        // Display base inspector gui
        base.OnInspectorGUI();
    }
Example #16
0
    public override void OnInspectorGUI()
    {
        // Get reference to script
        PursueTargetBehaviour script = target as PursueTargetBehaviour;

        // Declare help text
        string helpText = "While this script is enabled, it will use the attached Nav Mesh Agent component to allow this GameObject to pathfind to a destination.";

        // Display help text
        _showText = EditorGUILayout.BeginFoldoutHeaderGroup(_showText, "Info");
        if (_showText)
        {
            EditorGUILayout.HelpBox(helpText, MessageType.Info);
        }

        EditorGUILayout.EndFoldoutHeaderGroup();

        // Display base inspector gui
        base.OnInspectorGUI();
    }
Example #17
0
        public static bool FoldoutBegin(string title, string foldoutId, Object targetId, bool defaultState)
        {
#if UNITY_2019_1_OR_NEWER
            string key = "DustEngine.DustGUI.Foldout." + foldoutId;

            if (targetId != null)
            {
                key += "." + targetId.GetInstanceID();
            }

            bool state = SessionState.GetBool(key, defaultState);
            state = EditorGUILayout.BeginFoldoutHeaderGroup(state, title);
            SessionState.SetBool(key, state);

            IndentLevelInc();
            return(state);
#else
            return(FoldoutBegin(title));
#endif
        }
Example #18
0
    void OnGUI()
    {
        if (null == _mapGenerator)
        {
            _mapGenerator = GetMapInScene();
        }

        if (null == _mapGenerator)
        {
            //No Map in Scene
            GUILayout.Label("Create a MapGenerator on scene to continue.", EditorStyles.boldLabel);
            return;
        }

        showMapSettings = EditorGUILayout.BeginFoldoutHeaderGroup(showMapSettings, "Modify map size");

        if (showMapSettings)
        {
            Vector2Int mapSize = EditorGUILayout.Vector2IntField("Enter values", new Vector2Int(_tempMapSizeX, _tempMapSizeY));

            if (mapSize.x != _tempMapSizeX || mapSize.y != _tempMapSizeY)
            {
                _tempMapSizeX = mapSize.x;
                _tempMapSizeY = mapSize.y;
            }

            if (GUILayout.Button("Update map size")) //Si on clique sur le bouton generate
            {
                if (_mapGenerator.map.mapSize.x != mapSize.x || _mapGenerator.map.mapSize.y != mapSize.y)
                {
                    _mapGenerator.map.mapSize.x = mapSize.x;
                    _mapGenerator.map.mapSize.y = mapSize.y;

                    _tempMapSizeX = _mapGenerator.map.mapSize.x;
                    _tempMapSizeY = _mapGenerator.map.mapSize.y;

                    _mapGenerator.GenerateMap(); //On affiche le nouveau tableau sur la room tilemap
                }
            }
        }
    }
        public override void OnInspectorGUI()
        {
            base.OnPreInspectorGUI();

            if (_foldoutColorsAndFormatting = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutColorsAndFormatting, "Colors & Formatting"))
            {
                ItemDataField("Visible", ref _spinner.data.IsVisible);
                TextureField("Image", ref _spinner.data.Image);
                MaterialField("Material", ref _spinner.data.Material);
                ItemDataField("Show Bracket", ref _spinner.data.ShowBracket);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            if (_foldoutPosition = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutPosition, "Position"))
            {
                ItemDataField("", ref _spinner.data.Center);
                ItemDataField("Length", ref _spinner.data.Length);
                ItemDataField("Height", ref _spinner.data.Height);
                ItemDataField("Rotation", ref _spinner.data.Rotation);
                ItemDataField("Angle Max", ref _spinner.data.AngleMax, dirtyMesh: false);
                ItemDataField("Angle Min", ref _spinner.data.AngleMin, dirtyMesh: false);
                ItemDataField("Elasticity", ref _spinner.data.Elasticity, dirtyMesh: false);
                SurfaceField("Surface", ref _spinner.data.Surface);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            if (_foldoutPhysics = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutPhysics, "Physics"))
            {
                ItemDataField("Damping", ref _spinner.data.Damping, dirtyMesh: false);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            if (_foldoutMisc = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutMisc, "Misc"))
            {
                ItemDataField("Timer Enabled", ref _spinner.data.IsTimerEnabled, dirtyMesh: false);
                ItemDataField("Timer Interval", ref _spinner.data.TimerInterval, dirtyMesh: false);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            base.OnInspectorGUI();
        }
Example #20
0
    /// <summary>
    /// Shows a Foldout List of type T
    /// </summary>
    /// <typeparam name="T"> Class of the list (List<AudioClip> for example) </AudioClip></typeparam>
    /// <param name="myList">The list to show</param>
    /// <param name="type">The type of the list (must be a new/empty object).</param>
    /// <param name="headerLabel">The label for the foldout header.</param>
    /// <param name="addLabel">The label of the button used to add a new item to the list</param>
    public static void FoldoutObjectList <T>(List <T> myList, T type, string headerLabel, string addLabel) where T : Object
    {
        EditorGUILayout.Space();
        if (myList == null)
        {
            myList = new List <T>();
        }
        showFoldoutList = EditorGUILayout.BeginFoldoutHeaderGroup(showFoldoutList, "Weapon Sounds");
        if (showFoldoutList)
        {
            if (GUILayout.Button("Add Weapon Sound"))
            {
                myList.Add(type);
            }
            for (int i = 0; i < myList.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();
                myList[i] = (T)ObjectField(i.ToString(), myList[i], type, 30);
                if (GUILayout.Button("Remove"))
                {
                    myList.RemoveAt(i);
                }
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Remove Last Item"))
            {
                if (myList.Count >= 1)
                {
                    myList.RemoveAt(myList.Count - 1);
                }
            }
            if (GUILayout.Button("Clear List"))
            {
                myList.Clear();
            }
            EditorGUILayout.EndHorizontal();
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
    }
Example #21
0
        private void DisplaySveltoEcsEnginesEditorWindowContent()
        {
            var assembly          = Assembly.GetAssembly(ObservableEnginesSingletonContext.CompositionRoot.GetType());
            var observableEngines = assembly.GetTypes()
                                    .Where(x => x.ContainsCustomAttribute(typeof(ObservableEngineAttribute)))
                                    .ToArray();

            GUILayout.Label("List of observable engines:", EditorStyles.boldLabel);

            EditorGUILayout.BeginVertical();
            _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);

            for (var i = 0; i < observableEngines.Length; i++)
            {
                var observabilityAttributes = observableEngines[i]
                                              .GetCustomAttributes <ObservableEngineAttribute>()
                                              .ToArray();

                EditorGUILayout.BeginHorizontal();
                var engineExpanded = _enginesDisplayStateIndex.TryGetValue(observableEngines[i].Name, out var value) && value;

                _enginesDisplayStateIndex[observableEngines[i].Name] = EditorGUILayout.BeginFoldoutHeaderGroup(engineExpanded, $"{i + 1}. {observableEngines[i].Name}");

                if (engineExpanded)
                {
                    EditorGUILayout.BeginVertical();
                    for (var j = 0; j < observabilityAttributes.Length; j++)
                    {
                        DisplayComponents(observabilityAttributes[j]);
                        DisplayEntityCount(observabilityAttributes[j]);
                        GUILayout.Space(15);
                    }
                    EditorGUILayout.EndVertical();
                }

                EditorGUILayout.EndFoldoutHeaderGroup();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndScrollView();
            EditorGUILayout.EndVertical();
        }
        public override void OnInspectorGUI()
        {
            var controller = this.serializedObject.targetObject as BlockFromPolygon;

            serializedObject.Update();

            EditorGUILayout.PropertyField(height);
            EditorGUILayout.Separator();
            EditorGUILayout.PropertyField(topMaterial);
            EditorGUILayout.PropertyField(bottomMaterial);
            EditorGUILayout.PropertyField(sideMaterial);
            EditorGUILayout.PropertyField(sideUvUnwrapSettings);
            EditorGUILayout.PropertyField(pointedRoof);
            EditorGUILayout.PropertyField(pointedRoofHeight);
            EditorGUILayout.PropertyField(raiseFrontAndBackFacadeTop);
            EditorGUILayout.PropertyField(leanForward);

            if (controller.floorPolygon != null)
            {
                EditorGUILayout.BeginFoldoutHeaderGroup(false, "Polygon");
                foreach (var coordinate in (this.serializedObject.targetObject as BlockFromPolygon).floorPolygon)
                {
                    EditorGUILayout.LabelField(coordinate.ToString());
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }

            // EditorGUILayout.PropertyField(floor);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Set Test Floor"))
            {
                this.CreateTestFloor();
            }
            if (GUILayout.Button("Draw"))
            {
                var builder = new BlockFromPolygonBuilder(controller);
                builder.Draw();
            }
            EditorGUILayout.EndHorizontal();
            serializedObject.ApplyModifiedProperties();
        }
Example #23
0
        void DrawShadowSettings()
        {
            m_ShadowSettingsFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(m_ShadowSettingsFoldout.value, Styles.shadowSettingsText);
            if (m_ShadowSettingsFoldout.value)
            {
                EditorGUI.indentLevel++;
                CoreEditorUtils.DrawPopup(Styles.shadowCascadesText, m_ShadowCascadesProp, Styles.shadowCascadeOptions);
                ShadowCascadesOption cascades = (ShadowCascadesOption)m_ShadowCascadesProp.intValue;
                if (cascades == ShadowCascadesOption.FourCascades)
                {
                    EditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
                }
                else if (cascades == ShadowCascadesOption.TwoCascades)
                {
                    EditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
                }

                m_ShadowDepthBiasProp.floatValue  = EditorGUILayout.Slider(Styles.shadowDepthBias, m_ShadowDepthBiasProp.floatValue, 0.0f, LightweightRenderPipeline.maxShadowBias);
                m_ShadowNormalBiasProp.floatValue = EditorGUILayout.Slider(Styles.shadowNormalBias, m_ShadowNormalBiasProp.floatValue, 0.0f, LightweightRenderPipeline.maxShadowBias);

                m_ShadowHWDepthOffsetProp.floatValue = EditorGUILayout.Slider(Styles.shadowHWDepthOffsetContent, m_ShadowHWDepthOffsetProp.floatValue, 0.0f, LightweightRenderPipeline.maxShadowBias);
                m_ShadowHWDepthSlopeProp.floatValue  = EditorGUILayout.Slider(Styles.shadowHWDepthSlopeContent, m_ShadowHWDepthSlopeProp.floatValue, 0.0f, LightweightRenderPipeline.maxShadowBias);

                EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
                EditorGUILayout.PropertyField(m_SSShadowsDownsampleSupportedProp, Styles.supportSMDownsample);
                if (m_SSShadowsDownsampleSupportedProp.boolValue)
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.PropertyField(m_SSShadowsDownsampleSizeProp, Styles.SMDownsampleSize);
                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.PropertyField(m_SemiTransShadowsSupportedProp, Styles.supportSemitransShadows);



                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
                EditorGUILayout.Space();
            }
            EditorGUILayout.EndFoldoutHeaderGroup();
        }
Example #24
0
    public void DrawSizing()
    {
        SerializedProperty global = serializedObject.FindProperty("global");

        showSize = EditorGUILayout.BeginFoldoutHeaderGroup(showSize, "Size Requirements");
        if (showSize)
        {
            EditorGUILayout.PropertyField(global);
            if (!global.boolValue)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("size"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("canShareSpace"), new GUIContent("Overlap Allowed"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("canExpand"));
            }
            else
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("canShareSpace"), new GUIContent("Overlap Allowed"));
            }
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
    }
    public void ShowGrabSettings()
    {
        bool grabSettings = EditorGUILayout.BeginFoldoutHeaderGroup(interactibleObject.grabSettingsBool, "Grab Settings");

        EditorGUILayout.EndFoldoutHeaderGroup();

        if (interactibleObject.grabSettingsBool != grabSettings)
        {
            Undo.RecordObject(interactibleObject, "Toggled Grab Settings");
            interactibleObject.grabSettingsBool = grabSettings;
        }

        if (interactibleObject.grabSettingsBool)
        {
            EditorGUI.indentLevel += 1;
            ShowHoldType();
            ShowFollowType();
            ShowOffsetType();
            EditorGUI.indentLevel -= 1;
        }
    }
Example #26
0
    private void FoldoutHeaderGroup_RangeScale()
    {
        _showRangeScale = EditorGUILayout.BeginFoldoutHeaderGroup(_showRangeScale, "Range Scale", Style.FoldoutHeader.FontSize_13);
        EditorGUI.indentLevel++;
        if (_showRangeScale)
        {
            EditorGUILayout.Space();
            Popup();
            EditorGUILayout.Space(5);

            WaardeVan();
            WaardeTot();
            WaardesVan();
            WaardesTot();
            RangeScaleButton();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
        EditorGUI.EndFoldoutHeaderGroup();
        EditorGUI.indentLevel--;
    }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        ChanceCard card = (ChanceCard)target;

        RecreateActions(card);

        AddMenu(card);
        showActions = EditorGUILayout.BeginFoldoutHeaderGroup(showActions, "Actions (" + card.actionStrings.Count + ")");

        if (showActions)
        {
            for (int i = 0; i < card.actionStrings.Count; i++)
            {
                ActionString actionString = card.actionStrings[i];
                ShowActionCard(card, actionString, i);
            }
        }

        EditorGUILayout.EndFoldoutHeaderGroup();
    }
Example #28
0
        private void AudioClipsFoldout(BlockType type)
        {
            if (m_AudioClipsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(m_AudioClipsFoldout, "Audio Clips"))
            {
                if (type == BlockType.Air)
                {
                    EditorGUILayout.HelpBox("No Audio Clip", MessageType.Info);
                }
                else
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("m_DigAudio"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("m_PlaceAudio"));

                    EditorGUILayout.Space();

                    m_StepSounds.DoLayoutList();
                }
            }

            EditorGUILayout.EndFoldoutHeaderGroup();
        }
Example #29
0
 public void DrawShaderUI()
 {
     showRenderTypeSetting.value = EditorGUILayout.BeginFoldoutHeaderGroup(showRenderTypeSetting.value, Styles.renderTypeSetting);
     if (showRenderTypeSetting.value)
     {
         DrawRenderType();
     }
     EditorGUILayout.EndFoldoutHeaderGroup();
     showPropertySetting.value = EditorGUILayout.BeginFoldoutHeaderGroup(showPropertySetting.value, Styles.materialPropertySetting);
     if (showPropertySetting.value)
     {
         DrawShaderPropertys();
     }
     EditorGUILayout.EndFoldoutHeaderGroup();
     showEffectSetting.value = EditorGUILayout.BeginFoldoutHeaderGroup(showEffectSetting.value, Styles.effectPropertySetting);
     if (showEffectSetting.value)
     {
         DrawEffectValues();
     }
     EditorGUILayout.EndFoldoutHeaderGroup();
 }
Example #30
0
        public override void OnInspectorGUI()
        {
            OnPreInspectorGUI();

            if (_foldoutPosition = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutPosition, "Position"))
            {
                ItemReferenceField <KickerAuthoring, Kicker, KickerData>("Entry Kicker", ref _trough.Data.EntryKicker);
                ItemReferenceField <KickerAuthoring, Kicker, KickerData>("Exit Kicker", ref _trough.Data.ExitKicker);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            if (_foldoutMisc = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutMisc, "Misc"))
            {
                ItemDataField("Max Balls", ref _trough.Data.BallCount, dirtyMesh: false);
                ItemDataField("Switch Count", ref _trough.Data.SwitchCount, dirtyMesh: false);
                ItemDataField("Settle Time", ref _trough.Data.SettleTime, dirtyMesh: false);
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            base.OnInspectorGUI();
        }