您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

33 行
873 B

using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("OLD/UV Panner")]
public class PannerNode : CodeFunctionNode
{
public PannerNode()
{
name = "UVPanner";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_UVPanner", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_UVPanner(
[Slot(0, Binding.MeshUV0)] Vector2 uv,
[Slot(1, Binding.None)] Vector1 horizontalOffset,
[Slot(2, Binding.None)] Vector1 verticalOffset,
[Slot(3, Binding.None)] out Vector2 result)
{
result = Vector2.zero;
return
@"
{
result = float2(uv.x + horizontalOffset, uv.y + verticalOffset);
}";
}
}
}