浏览代码

added Randomizer tag UIElements editor

/main
Steven Leal 4 年前
当前提交
be8be73b
共有 2 个文件被更改,包括 35 次插入0 次删除
  1. 32
      com.unity.perception/Editor/Randomization/Editors/RandomizerTagEditor.cs
  2. 3
      com.unity.perception/Editor/Randomization/Editors/RandomizerTagEditor.cs.meta

32
com.unity.perception/Editor/Randomization/Editors/RandomizerTagEditor.cs


using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.UIElements;
namespace UnityEngine.Experimental.Perception.Randomization.Editor
{
[CustomEditor(typeof(RandomizerTag), true)]
public class RandomizerTagEditor : UnityEditor.Editor
{
public override VisualElement CreateInspectorGUI()
{
var rootElement = new VisualElement();
CreatePropertyFields(rootElement);
return rootElement;
}
void CreatePropertyFields(VisualElement rootElement)
{
var iterator = serializedObject.GetIterator();
iterator.NextVisible(true);
do
{
if (iterator.name == "m_Script")
continue;
var propertyField = new PropertyField(iterator.Copy());
propertyField.Bind(serializedObject);
rootElement.Add(propertyField);
} while (iterator.NextVisible(false));
}
}
}

3
com.unity.perception/Editor/Randomization/Editors/RandomizerTagEditor.cs.meta


fileFormatVersion: 2
guid: 364d57cb71da4535b77257c294c850f7
timeCreated: 1611697363
正在加载...
取消
保存