您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
824 B
25 行
824 B
using UnityEngine;
|
|
using UnityEditor;
|
|
using UnityEditor.UIElements;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace UnityEngine.Experimental.Perception.Randomization.Editor
|
|
{
|
|
class FloatRangeElement : VisualElement
|
|
{
|
|
public FloatRangeElement(SerializedProperty property)
|
|
{
|
|
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
|
$"{StaticData.uxmlDir}/Sampler/FloatRangeElement.uxml");
|
|
template.CloneTree(this);
|
|
|
|
var minimumField = this.Q<FloatField>("minimum");
|
|
minimumField.bindingPath = property.propertyPath + ".minimum";
|
|
|
|
var maximumField = this.Q<FloatField>("maximum");
|
|
maximumField.bindingPath = property.propertyPath + ".maximum";
|
|
|
|
this.Bind(property.serializedObject);
|
|
}
|
|
}
|
|
}
|