Skip to content

0kk470/Unity_AccordionUI

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
Gif
 
 
 
 
 
 
 
 

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);
       }
   }

About

An UGUI Extension based on ChoMPi's implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages