您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
63 行
1.3 KiB
63 行
1.3 KiB
using System;
|
|
|
|
namespace UnityEngine.MaterialGraph
|
|
{
|
|
[Serializable]
|
|
public enum SlotValueType
|
|
{
|
|
SamplerState,
|
|
Matrix4,
|
|
Matrix3,
|
|
Matrix2,
|
|
Texture2D,
|
|
Dynamic,
|
|
Vector4,
|
|
Vector3,
|
|
Vector2,
|
|
Vector1
|
|
}
|
|
|
|
public enum ConcreteSlotValueType
|
|
{
|
|
SamplerState,
|
|
Matrix4,
|
|
Matrix3,
|
|
Matrix2,
|
|
Texture2D,
|
|
Vector4,
|
|
Vector3,
|
|
Vector2,
|
|
Vector1,
|
|
Error
|
|
}
|
|
|
|
public static class SlotValueHelper
|
|
{
|
|
public enum ChannelCount
|
|
{
|
|
Zero = 0,
|
|
One = 1,
|
|
Two = 2,
|
|
Three = 3,
|
|
Four = 4,
|
|
}
|
|
|
|
public static ChannelCount GetChannelCount(ConcreteSlotValueType type)
|
|
{
|
|
switch (type)
|
|
{
|
|
case ConcreteSlotValueType.Vector4:
|
|
return ChannelCount.Four;
|
|
case ConcreteSlotValueType.Vector3:
|
|
return ChannelCount.Three;
|
|
case ConcreteSlotValueType.Vector2:
|
|
return ChannelCount.Two;
|
|
case ConcreteSlotValueType.Vector1:
|
|
return ChannelCount.One;
|
|
default:
|
|
return ChannelCount.Zero;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|