浏览代码

Default control attribute (so far only for floats)

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

15
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Controls/DefaultControl.cs


using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityEngine.Experimental.UIElements;
using UnityEngine.MaterialGraph;
public class DefaultControlAttribute : Attribute
[AttributeUsage(AttributeTargets.Property)]
public class DefaultControlAttribute : Attribute, IControlAttribute
public VisualElement InstantiateControl(AbstractMaterialNode node, PropertyInfo propertyInfo)
{
if (MultiFloatControlView.validTypes.Contains(propertyInfo.PropertyType))
return new MultiFloatControlView(null, "X", "Y", "Z", "W", node, propertyInfo);
return null;
}
}
}
正在加载...
取消
保存