private void OnDisable()
        {
            instance = null;

            m_Content?.OnDropdownClosed();
            m_Content = null;
        }
Esempio n. 2
0
        public static void ShowDropdown(VisualElement parent, DropdownContent content)
        {
            if (parent == null || content == null)
            {
                return;
            }

            instance = new DropdownElement();
            instance.Add(content);
            instance.m_Content = content;
            parent.Add(instance);
            content.OnDropdownShown();
        }
        public static void ShowDropdown(DropdownContent content)
        {
            if (instance != null || content == null)
            {
                return;
            }

            instance = CreateInstance <DropdownContainer>();
            instance.rootVisualElement.Add(content);

            content.container  = instance;
            instance.m_Content = content;

            instance.ShowAsDropDown(content.position, content.windowSize);
            content.OnDropdownShown();
        }