public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { base.OnGUI(position, property, label); //EditorGUILayout.PropertyField(property.FindPropertyRelative("clearFlag"), new GUIContent("Background Flag", "")); //EditorGUILayout.PropertyField(property.FindPropertyRelative("backgroundColor"), new GUIContent("Background Color", "")); EditorGUILayout.PropertyField(property.FindPropertyRelative("useSceneAmbientColor"), new GUIContent("Scene Ambience", "")); if (!property.FindPropertyRelative("useSceneAmbientColor").boolValue) { EditorGUILayout.PropertyField(property.FindPropertyRelative("ambientColor"), new GUIContent("Ambient Color", "")); } //EditorGUILayout.PropertyField(property.FindPropertyRelative("overlay")); EditorGUILayout.PropertyField(property.FindPropertyRelative("blur")); GUILayout.Space(2); EditorGUILayout.PropertyField(property.FindPropertyRelative("lightsEnabled"), new GUIContent("Apply VLSLight", "")); GUI.enabled = property.FindPropertyRelative("lightsEnabled").boolValue; { EditorGUI.indentLevel++; VLSProShaderEditor.GenerateSelectionList(property); property.FindPropertyRelative("lightLayerMask").intValue = EditorGUILayout.MaskField("Light Layers", property.FindPropertyRelative("lightLayerMask").intValue, VLSProShaderEditor.LightPassList); EditorGUILayout.PropertyField(property.FindPropertyRelative("lightIntensity"), new GUIContent("Light Intensity", "")); EditorGUI.indentLevel--; } GUI.enabled = true; }
public override void OnInspectorGUI() { serializedObject.Update(); { //EditorGUILayout.PropertyField(useAsUtility); //if (useAsUtility.boolValue) // EditorGUILayout.HelpBox("These settings will not render to the camera. You must pass a RenderTexture and a Light Layer name/index into the 'BlitLightsToTexture' function to render lights onto a texture.", MessageType.Warning); VLSLayerList.Show(lightPasses, "Light Passes"); EditorGUILayout.Space(); EditorGUILayout.PrefixLabel("Base Layer"); EditorGUI.indentLevel++; { EditorGUILayout.HelpBox("Layer and Background settings should be set using the attached camera's 'Background' and 'Culling Mask' settings.", MessageType.Info); EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("useSceneAmbientColor"), new GUIContent("Scene Ambience", "")); if (!defaultLayer.FindPropertyRelative("useSceneAmbientColor").boolValue) { EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("ambientColor"), new GUIContent("Ambient Color", "")); } EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("blur")); //EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("overlay")); GUILayout.Space(2); EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("lightsEnabled"), new GUIContent("Apply VLSLight", "")); GUI.enabled = defaultLayer.FindPropertyRelative("lightsEnabled").boolValue; { EditorGUI.indentLevel++; //VLSProShaderEditor.GenerateSelectionList(defaultLayer); EditorGUI.BeginChangeCheck(); { defaultLayer.FindPropertyRelative("lightLayerMask").intValue = EditorGUILayout.MaskField("Light Layers", defaultLayer.FindPropertyRelative("lightLayerMask").intValue, VLSProShaderEditor.LightPassList); } EditorGUI.EndChangeCheck(); EditorGUILayout.PropertyField(defaultLayer.FindPropertyRelative("lightIntensity"), new GUIContent("Light Intensity", "")); EditorGUI.indentLevel--; } GUI.enabled = true; } EditorGUI.indentLevel--; EditorGUILayout.Space(); VLSLayerList.Show(layerPasses, "Extra Layer Passes"); } serializedObject.ApplyModifiedProperties(); if (GUI.changed) { VLSProShaderEditor.GenerateSelectionList(defaultLayer); } }