Unity Accordion UI by 0kk470 - 7

ToolsGUIExtensions

An UGUI Extension based on ChoMPi's implementation

Unity 2017.4.14f1Unknown LicenseUpdated 21 days agoCreated on April 12th, 2019
Go to source

AccordionUI


UnityVersion : 2017.4.14f


Note

This is based on ChoMPi 's work.

You can check more information on this topic

Usage

Just download the project and see the demo scene.

  • demo

img

  • AddListener

Adding a listener to this script is similar to UGUI’s Button.

   public class yourUIClass:MonoBehaviour
   {
       private UIAccordion m_UIAccordion;

       private void Awake()
       {
           m_UIAccordion = GetComponent<UIAccordion>();
           m_UIAccordion.onSelectElement.AddListener(OnElementSelect);
       }

       private void OnDestroy()
       {
           m_UIAccordion.onSelectElement.RemoveListener(OnElementSelect);
       }
       private void OnElementSelect(int index)
       {
           Debug.Log("New Element Index:" + index);
       }
   }
Show all projects by 0kk470