FogPointLightEditor.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using UnityEditor;
  3. namespace VolumetricFogAndMist2 {
  4. [CustomEditor(typeof(FogPointLight))]
  5. public class FogPointLightEditor : Editor {
  6. SerializedProperty inscattering, intensity;
  7. private void OnEnable() {
  8. inscattering = serializedObject.FindProperty("inscattering");
  9. intensity = serializedObject.FindProperty("intensity");
  10. }
  11. public override void OnInspectorGUI() {
  12. EditorGUILayout.HelpBox("Custom multipliers for this point light only. Manage global settings using the Point Light Manager.", MessageType.Info);
  13. if (GUILayout.Button("Open Point Light Manager")) {
  14. Selection.activeGameObject = VolumetricFogManager.pointLightManager.gameObject;
  15. GUIUtility.ExitGUI();
  16. }
  17. EditorGUILayout.Separator();
  18. serializedObject.Update();
  19. EditorGUILayout.PropertyField(inscattering);
  20. EditorGUILayout.PropertyField(intensity);
  21. serializedObject.ApplyModifiedProperties();
  22. }
  23. }
  24. }