浏览代码

moved test app param field in scenario inspector

/addressables-test
sleal-unity 4 年前
当前提交
b17a15fa
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 11
      com.unity.perception/Editor/Randomization/Editors/ScenarioBaseEditor.cs
  2. 1
      com.unity.perception/Editor/Randomization/Uxml/ScenarioBaseElement.uxml

11
com.unity.perception/Editor/Randomization/Editors/ScenarioBaseEditor.cs


CreatePropertyFields();
CheckIfConstantsExist();
var appParamField = m_Root.Q<ObjectField>("test-app-param");
appParamField.objectType = typeof(TextAsset);
var generateConfigButton = m_Root.Q<Button>("generate-json-config");
generateConfigButton.clicked += () =>
{

PlayerPrefs.SetString(k_ConfigFilePlayerPrefKey, filePath);
};
var appParamField = new ObjectField();
appParamField.objectType = typeof(TextAsset);
appParamField.BindProperty(serializedObject.FindProperty(nameof(ScenarioBase.testAppParam)));
var scenarioPropertiesContainer = m_Root.Q<VisualElement>("scenario-properties-container");
scenarioPropertiesContainer.Add(appParamField);
return m_Root;
}

case "constants":
m_HasConstantsField = true;
UIElementsEditorUtilities.CreatePropertyFields(iterator.Copy(), m_ConstantsListVisualContainer);
break;
case nameof(ScenarioBase.testAppParam):
break;
default:
{

1
com.unity.perception/Editor/Randomization/Uxml/ScenarioBaseElement.uxml


<TextElement
class="scenario__info-box"
text="Scenarios control the execution flow of your simulation by applying randomization parameters. Make sure to always have only one scenario active within your scene."/>
<editor:ObjectField name="test-app-param" label="Test App Param" binding-path="testAppParam"/>
<VisualElement name="constants-container">
<Foldout style="padding-left: 16px" text="Constants" name="constants-list" tooltip="A list of parameters for this scenario that will be JSON serialized in the configuration file."/>
<editor:PropertyField name="configuration-file-name" label="Constants File Name" binding-path="serializedConstantsFileName"/>

正在加载...
取消
保存