浏览代码

Fixes #242 by initalizing the color space field properly

/main
Peter Bay Bastian 7 年前
当前提交
00a8f677
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
  2. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporterEditor.cs

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


{
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)
return;
var path = AssetDatabase.GetAssetPath(asset);

return;
}
selectedGuid = newSelectionGuid;
selectedGuid = assetGuid;
var textGraph = File.ReadAllText(path, Encoding.UTF8);
graphObject = CreateInstance<GraphObject>();

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporterEditor.cs


{
var window = CreateInstance<MaterialGraphEditWindow>();
window.Show();
window.ChangeSelection(guid);
window.Initialize(guid);
}
return true;
}

正在加载...
取消
保存