您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
35 行
844 B
35 行
844 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Serializable]
|
|
public class Vector2ShaderProperty : VectorShaderProperty
|
|
{
|
|
public override PropertyType propertyType
|
|
{
|
|
get { return PropertyType.Vector2; }
|
|
}
|
|
|
|
public override Vector4 defaultValue
|
|
{
|
|
get { return new Vector4(value.x, value.y, 0, 0); }
|
|
}
|
|
|
|
public override string GetInlinePropertyDeclarationString()
|
|
{
|
|
return "float2 " + referenceName + ";";
|
|
}
|
|
|
|
public override PreviewProperty GetPreviewMaterialProperty()
|
|
{
|
|
return new PreviewProperty()
|
|
{
|
|
m_Name = referenceName,
|
|
m_PropType = PropertyType.Vector2,
|
|
m_Vector4 = value
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|