MPUIKitShaderGUI.cs 845 B

1234567891011121314151617181920212223242526
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace MPUIKIT.Editor
  4. {
  5. public class MPImageShaderGUI : ShaderGUI
  6. {
  7. private bool _showValues;
  8. public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
  9. {
  10. EditorGUILayout.HelpBox(
  11. "Nothing to modify here. Select an MPImage component in the hierarchy and modify the values in the inspector.",
  12. MessageType.Info);
  13. if (GUILayout.Button(_showValues ? "Hide Debug Values" : "Show Debug Values", EditorStyles.miniLabel)) _showValues = !_showValues;
  14. if (_showValues)
  15. {
  16. EditorGUI.BeginDisabledGroup(true);
  17. base.OnGUI(materialEditor, properties);
  18. EditorGUI.EndDisabledGroup();
  19. }
  20. }
  21. }
  22. }