Skip to content

Instantly share code, notes, and snippets.

@rngtm
Created October 23, 2018 23:41
Show Gist options
  • Select an option

  • Save rngtm/63ebb4bf87b9df911bf5529874966c70 to your computer and use it in GitHub Desktop.

Select an option

Save rngtm/63ebb4bf87b9df911bf5529874966c70 to your computer and use it in GitHub Desktop.
シェーダーグラフファイルを作成するウィンドウ
using UnityEngine;
using UnityEditor;
public class ShaderGraphGegneratorWindow : EditorWindow
{
GUIStyle m_ButtonStyle;
[MenuItem("Tools/ShaderGraph Generator")]
static void Open()
{
GetWindow<ShaderGraphGegneratorWindow>("ShaderGraph Generator");
}
void OnGUI()
{
if (m_ButtonStyle == null)
{
m_ButtonStyle = new GUIStyle(GUI.skin.button);
m_ButtonStyle.wordWrap = true;
}
if (GUILayout.Button("Generate PBR Graph", m_ButtonStyle))
{
EditorApplication.ExecuteMenuItem("Assets/Create/Shader/PBR Graph");
}
if (GUILayout.Button("Generate Unlit Graph", m_ButtonStyle))
{
EditorApplication.ExecuteMenuItem("Assets/Create/Shader/Unlit Graph");
}
}
}
@rngtm

rngtm commented Oct 23, 2018

Copy link
Copy Markdown
Author

使い方
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment