Guest User

Untitled

a guest
Oct 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. public class ShaderGraphGegneratorWindow : EditorWindow
  5. {
  6. GUIStyle m_ButtonStyle;
  7. [MenuItem("Tools/ShaderGraph Generator")]
  8. static void Open()
  9. {
  10. GetWindow<ShaderGraphGegneratorWindow>("ShaderGraph Generator");
  11. }
  12.  
  13. void OnGUI()
  14. {
  15. if (m_ButtonStyle == null)
  16. {
  17. m_ButtonStyle = new GUIStyle(GUI.skin.button);
  18. m_ButtonStyle.wordWrap = true;
  19. }
  20.  
  21. if (GUILayout.Button("Generate PBR Graph", m_ButtonStyle))
  22. {
  23. EditorApplication.ExecuteMenuItem("Assets/Create/Shader/PBR Graph");
  24. }
  25. if (GUILayout.Button("Generate Unlit Graph", m_ButtonStyle))
  26. {
  27. EditorApplication.ExecuteMenuItem("Assets/Create/Shader/Unlit Graph");
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment