BasePurchasingState.cs 872 B

1234567891011121314151617181920212223242526
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using UnityEngine.UIElements;
  4. namespace UnityEditor.Purchasing
  5. {
  6. internal abstract class BasePurchasingState : SimpleStateMachine<bool>.State
  7. {
  8. protected List<IPurchasingSettingsUIBlock> m_UIBlocks;
  9. protected BasePurchasingState(string stateName, SimpleStateMachine<bool> stateMachine)
  10. : base(stateName, stateMachine)
  11. {
  12. m_UIBlocks = new List<IPurchasingSettingsUIBlock>();
  13. m_UIBlocks.Add(PlatformsAndStoresServiceSettingsBlock.CreateStateSpecificBlock(IsEnabled()));
  14. m_UIBlocks.Add(new AnalyticsWarningSettingsBlock());
  15. }
  16. internal List<VisualElement> GetStateUI()
  17. {
  18. return m_UIBlocks.Select(block => block.GetUIBlockElement()).ToList();
  19. }
  20. internal abstract bool IsEnabled();
  21. }
  22. }