浏览代码

Open up the correct graph when double clicked on.

/main
Tim Cooper 7 年前
当前提交
98c7f93e
共有 2 个文件被更改,包括 23 次插入1 次删除
  1. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/MasterRemapGraphImporterEditor.cs
  2. 15
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/MasterRemapGraphImporterEditor.cs


using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.Experimental.AssetImporters;
using UnityEditor.MaterialGraph.Drawing;
using UnityEngine;

window.Show();
window.ChangeSelection(asset);
}
}
[OnOpenAsset]
static bool OnOpenAsset(int instanceID, int line)
{
var path = AssetDatabase.GetAssetPath(instanceID);
ShowGraphEditWindow(path);
return true;
}
}

15
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs


using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.Experimental.AssetImporters;
using UnityEditor.MaterialGraph.Drawing;
using UnityEngine;

}
}
private static void ShowGraphEditWindow(string path)
private static bool ShowGraphEditWindow(string path)
if (asset == null)
return false;
var windows = Resources.FindObjectsOfTypeAll<SubGraphEditWindow>();
bool foundWindow = false;
foreach (var w in windows)

window.Show();
window.ChangeSelection(asset);
}
return true;
}
[OnOpenAsset]
static bool OnOpenAsset(int instanceID, int line)
{
var path = AssetDatabase.GetAssetPath(instanceID);
ShowGraphEditWindow(path);
return true;
}
}
正在加载...
取消
保存