EdgeDetectEffectNormalsEditor.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. @script ExecuteInEditMode()
  2. @CustomEditor (EdgeDetectEffectNormals)
  3. class EdgeDetectEffectNormalsEditor extends Editor
  4. {
  5. var serObj : SerializedObject;
  6. var mode : SerializedProperty;
  7. var sensitivityDepth : SerializedProperty;
  8. var sensitivityNormals : SerializedProperty;
  9. var edgesOnly : SerializedProperty;
  10. var edgesOnlyBgColor : SerializedProperty;
  11. function OnEnable () {
  12. serObj = new SerializedObject (target);
  13. mode = serObj.FindProperty("mode");
  14. sensitivityDepth = serObj.FindProperty("sensitivityDepth");
  15. sensitivityNormals = serObj.FindProperty("sensitivityNormals");
  16. edgesOnly = serObj.FindProperty("edgesOnly");
  17. edgesOnlyBgColor = serObj.FindProperty("edgesOnlyBgColor");
  18. }
  19. function OnInspectorGUI ()
  20. {
  21. EditorGUILayout.PropertyField (mode, new GUIContent("Mode"));
  22. EditorGUILayout.PropertyField (sensitivityDepth, new GUIContent("Depth sensitivity"));
  23. EditorGUILayout.PropertyField (sensitivityNormals, new GUIContent("Normals sensitivity"));
  24. EditorGUILayout.Separator ();
  25. edgesOnly.floatValue = EditorGUILayout.Slider ("Draw edges only", edgesOnly.floatValue, 0.0, 1.0);
  26. EditorGUILayout.PropertyField (edgesOnlyBgColor, new GUIContent ("Background color"));
  27. serObj.ApplyModifiedProperties();
  28. }
  29. }