浏览代码

Add preview node

/main
Jens Holm 7 年前
当前提交
c5b4edc2
共有 2 个文件被更改,包括 41 次插入0 次删除
  1. 30
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PreviewNode.cs
  2. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PreviewNode.cs.meta

30
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PreviewNode.cs


using System.Reflection;
namespace UnityEngine.MaterialGraph
{
[Title("Preview Node")]
public class PreviewNode : CodeFunctionNode
{
public const int InputSlotId = 0;
public const int OutputSlotId = 1;
public override bool hasPreview { get { return true; } }
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Preview", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Preview(
[Slot(0, Binding.None)] DynamicDimensionVector input,
[Slot(1, Binding.None)] out DynamicDimensionVector output)
{
return
@"
{
output = input;
}
";
}
}
}

11
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PreviewNode.cs.meta


fileFormatVersion: 2
guid: 0a9c3dd2c3b0c4347876f3e448be2046
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存