浏览代码

Fix saving the shader so that it can be used on objects in the scene.

/main
Tim Cooper 8 年前
当前提交
8f917469
共有 3 个文件被更改,包括 7 次插入2 次删除
  1. 6
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphEditWindow.cs
  2. 2
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarPresenter.cs
  3. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs

6
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphEditWindow.cs


if (!string.IsNullOrEmpty(path) && m_InMemoryAsset != null)
{
File.WriteAllText (path, EditorJsonUtility.ToJson (m_InMemoryAsset.graph as object));
AssetDatabase.Refresh ();
AssetDatabase.ImportAsset (path);
if (asset != null)
if (asset != null) {
m_Selected = null;
}
}
}
}

2
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarPresenter.cs


void UpdateAsset()
{
//TODO: We need two currently.. fix later
m_Owner.UpdateAsset ();
m_Owner.UpdateAsset ();
}
}

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs


if (shader == null)
return null;
File.WriteAllText (path, shaderString);
ShaderUtil.UpdateShaderAsset (shader, shaderString);
var shaderImporter = AssetImporter.GetAtPath(path) as ShaderImporter;

正在加载...
取消
保存