using System.IO; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.Perception.Randomization.Scenarios; using UnityEngine.UIElements; namespace UnityEditor.Perception.Randomization { [CustomEditor(typeof(ScenarioBase), true)] class ScenarioBaseEditor : Editor { VisualElement m_ConstantsListVisualContainer; bool m_HasConstantsField; VisualElement m_InspectorPropertiesContainer; VisualElement m_RandomizerListPlaceholder; VisualElement m_Root; ScenarioBase m_Scenario; SerializedObject m_SerializedObject; const string k_ConfigFilePlayerPrefKey = "ScenarioBaseEditor/configFilePath"; public override VisualElement CreateInspectorGUI() { m_Scenario = (ScenarioBase)target; m_SerializedObject = new SerializedObject(m_Scenario); m_Root = AssetDatabase.LoadAssetAtPath( $"{StaticData.uxmlDir}/ScenarioBaseElement.uxml").CloneTree(); #if !ENABLE_SCENARIO_APP_PARAM_CONFIG var configuration = m_Root.Q("configuration-asset"); configuration.style.display = DisplayStyle.None; m_Scenario.configuration = null; EditorUtility.SetDirty(m_Scenario); #endif m_RandomizerListPlaceholder = m_Root.Q("randomizer-list-placeholder"); CreatePropertyFields(); CheckIfConstantsExist(); var generateConfigButton = m_Root.Q