您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
935 B
33 行
935 B
using System;
|
|
using System.Text;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Serializable]
|
|
public abstract class VectorShaderProperty : AbstractShaderProperty<Vector4>
|
|
{
|
|
public override string GetPropertyBlockString()
|
|
{
|
|
var result = new StringBuilder();
|
|
result.Append(referenceName);
|
|
result.Append("(\"");
|
|
result.Append(displayName);
|
|
result.Append("\", Vector) = (");
|
|
result.Append(value.x);
|
|
result.Append(",");
|
|
result.Append(value.y);
|
|
result.Append(",");
|
|
result.Append(value.z);
|
|
result.Append(",");
|
|
result.Append(value.w);
|
|
result.Append(")");
|
|
return result.ToString();
|
|
}
|
|
|
|
public override string GetPropertyDeclarationString()
|
|
{
|
|
return "float4 " + referenceName + ";";
|
|
}
|
|
}
|
|
}
|