浏览代码

Minor changes to VectorControl

/main
Peter Bay Bastian 7 年前
当前提交
a15cfa1d
共有 1 个文件被更改,包括 2 次插入11 次删除
  1. 13
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Controls/VectorControl.cs

13
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Controls/VectorControl.cs


public MultiFloatControlView(string label, string subLabel1, string subLabel2, string subLabel3, string subLabel4, AbstractMaterialNode node, PropertyInfo propertyInfo)
{
int components;
if (propertyInfo.PropertyType == typeof(float))
components = 1;
else if (propertyInfo.PropertyType == typeof(Vector2))
components = 2;
else if (propertyInfo.PropertyType == typeof(Vector3))
components = 3;
else if (propertyInfo.PropertyType == typeof(Vector4))
components = 4;
else
var components = Array.IndexOf(validTypes, propertyInfo.PropertyType) + 1;
if (components == -1)
throw new ArgumentException("Property must be of type float, Vector2, Vector3 or Vector4.", "propertyInfo");
m_Node = node;

value[index] = (float)evt.newValue;
SetValue(value);
m_UndoGroup = -1;
// Dirty(ChangeType.Repaint);
});
doubleField.RegisterCallback<InputEvent>(evt =>
{

正在加载...
取消
保存