您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
945 B
29 行
945 B
using System;
|
|
using System.Text;
|
|
using UnityEditor.Graphing;
|
|
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(NodeUtils.FloatToShaderValue(value.x));
|
|
result.Append(",");
|
|
result.Append(NodeUtils.FloatToShaderValue(value.y));
|
|
result.Append(",");
|
|
result.Append(NodeUtils.FloatToShaderValue(value.z));
|
|
result.Append(",");
|
|
result.Append(NodeUtils.FloatToShaderValue(value.w));
|
|
result.Append(")");
|
|
return result.ToString();
|
|
}
|
|
}
|
|
}
|