You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
904 B
30 lines
904 B
using UnityEditor;
|
|
#if UNITY_2020_2_OR_NEWER
|
|
using UnityEditor.AssetImporters;
|
|
#else
|
|
using UnityEditor.Experimental.AssetImporters;
|
|
#endif
|
|
using UnityEngine;
|
|
using Debug = System.Diagnostics.Debug;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[CustomEditor(typeof(ShaderSubGraphImporter))]
|
|
class ShaderSubGraphImporterEditor : ScriptedImporterEditor
|
|
{
|
|
public override bool showImportedObject => Unsupported.IsDeveloperMode();
|
|
protected override bool needsApplyRevert => false;
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
if (GUILayout.Button("Open Shader Editor"))
|
|
{
|
|
AssetImporter importer = target as AssetImporter;
|
|
Debug.Assert(importer != null, "importer != null");
|
|
ShaderGraphImporterEditor.ShowGraphEditWindow(importer.assetPath);
|
|
}
|
|
|
|
ApplyRevertGUI();
|
|
}
|
|
}
|
|
}
|