浏览代码

Add template path export.

/main
Tim Cooper 7 年前
当前提交
ec95c348
共有 5 个文件被更改,包括 34 次插入24 次删除
  1. 27
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ShaderGenerator.cs
  2. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporterEditor.cs
  3. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph.meta
  4. 10
      MaterialGraphProject/Assets/GraphFramework.meta
  5. 9
      MaterialGraphProject/Assets/Resources.meta

27
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ShaderGenerator.cs


result = Path.Combine(result, path[i]);
result = Path.Combine(result, templateName);
return result;
if (File.Exists(result))
return result;
//todo: fix this up... quick hack for working
// in a package
var path2 = new List<string>
{
"Packages",
"com.unity.render-pipelines.shadergraph",
"Editor",
"Templates"
};
string result2 = path2[0];
for (int i = 1; i < path2.Count; i++)
result2 = Path.Combine(result2, path2[i]);
result2 = Path.Combine(result2, templateName);
result2 = Path.GetFullPath(result2);
if (File.Exists(result2))
return result2;
return string.Empty;
}
private const string kErrorString = @"ERROR!";

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


using System;
using UnityEditor.ShaderGraph;
using Object = UnityEngine.Object;
[CustomEditor(typeof(ShaderGraphImporter))]
public class ShaderGraphImporterEditor : ScriptedImporterEditor

[OnOpenAsset(0)]
public static bool OnOpenAsset(int instanceID, int line)
{
Debug.Log(instanceID);
var path = AssetDatabase.GetAssetPath(instanceID);
return ShowGraphEditWindow(path);
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph.meta


fileFormatVersion: 2
guid: e47723110397ff04388ed94332cd6208
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
MaterialGraphProject/Assets/GraphFramework.meta


fileFormatVersion: 2
guid: 8da2c542223390a47bf9ce62a39abff5
folderAsset: yes
timeCreated: 1445418016
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/Resources.meta


fileFormatVersion: 2
guid: 955cdc8ef0dfe8648937a748fd998dab
folderAsset: yes
timeCreated: 1481301248
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存