浏览代码

Merge pull request #1744 from Unity-Technologies/sg/fix-for-saving-dirty-shader-graph

Fix for saving dirty shader graph
/main
GitHub 6 年前
当前提交
58ccb0db
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1
      com.unity.shadergraph/CHANGELOG.md
  2. 3
      com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs

1
com.unity.shadergraph/CHANGELOG.md


- Texture 2D Array and Texture 3D nodes can no longer be used in the vertex shader.
- Shader graphs using alpha clip now generate correct depth and shadow passes.
- `Normal Create` node has been renamed to `Normal From Texture`.
- When you close the Shader Graph after you have modified a file, the prompt about saving your changes now shows the file name as well.
- `Blend` node now supports Overwrite mode.
- `Simple Noise` node no longer has a loop.
- The `Polygon` node now calculates radius based on apothem.

3
com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs


{
if (graphObject != null)
{
if (graphObject.isDirty && EditorUtility.DisplayDialog("Shader Graph Has Been Modified", "Do you want to save the changes you made in the shader graph?\n\nYour changes will be lost if you don't save them.", "Save", "Don't Save"))
string nameOfFile = AssetDatabase.GUIDToAssetPath(selectedGuid);
if (graphObject.isDirty && EditorUtility.DisplayDialog("Shader Graph Has Been Modified", "Do you want to save the changes you made in the shader graph?\n" + nameOfFile + "\n\nYour changes will be lost if you don't save them.", "Save", "Don't Save"))
UpdateAsset();
Undo.ClearUndo(graphObject);
DestroyImmediate(graphObject);

正在加载...
取消
保存