{
var guid = selectedGuid;
selectedGuid = null;
ChangeSelection(guid);
Initialize(guid);
}
if (graphObject == null)
public void ChangeSelection(string newSelectionGuid)
public void Initialize(string assetGuid)
var asset = AssetDatabase.LoadAssetAtPath<Object>(AssetDatabase.GUIDToAssetPath(newSelectionGuid));
m_ColorSpace = PlayerSettings.colorSpace;
var asset = AssetDatabase.LoadAssetAtPath<Object>(AssetDatabase.GUIDToAssetPath(assetGuid));
if (asset == null)
return;
if (selectedGuid == newSelectionGuid)
if (selectedGuid == assetGuid)
var path = AssetDatabase.GetAssetPath(asset);
selectedGuid = newSelectionGuid;
selectedGuid = assetGuid;
var textGraph = File.ReadAllText(path, Encoding.UTF8);
graphObject = CreateInstance<GraphObject>();
var window = CreateInstance<MaterialGraphEditWindow>();
window.Show();
window.ChangeSelection(guid);
window.Initialize(guid);
return true;