void InitIfNeeded() { if (m_CoreConvertersList.Any()) { return; } m_CoreConvertersList = new List <RenderPipelineConverter>(); // This is the drop down choices. m_ConverterContainers = TypeCache.GetTypesDerivedFrom <RenderPipelineConverterContainer>(); foreach (var continerType in m_ConverterContainers) { var container = (RenderPipelineConverterContainer)Activator.CreateInstance(continerType); m_Containers.Add(container); m_ContainerChoices.Add(container.name); } if (m_ConverterContainers.Any()) { GetConverters(); } else { ClearConverterStates(); } }
public void CreateGUI() { InitIfNeeded(); if (m_ConverterContainers.Any()) { m_SerializedObject = new SerializedObject(this); converterEditorAsset.CloneTree(rootVisualElement); rootVisualElement.Q <DropdownField>("conversionsDropDown").choices = m_ContainerChoices; rootVisualElement.Q <DropdownField>("conversionsDropDown").index = m_ContainerChoiceIndex; RecreateUI(); var button = rootVisualElement.Q <Button>("convertButton"); button.RegisterCallback <ClickEvent>(Convert); button.SetEnabled(false); var initButton = rootVisualElement.Q <Button>("initializeButton"); initButton.RegisterCallback <ClickEvent>(InitializeAllActiveConverters); } }