protected override void Awake()
 {
     base.Awake();
     base.transition       = Transition.None;
     base.toggleTransition = ToggleTransition.None;
     this.m_Accordion      = this.gameObject.GetComponentInParent <Accordion>();
     this.m_RectTransform  = this.transform as RectTransform;
     this.m_LayoutElement  = this.gameObject.GetComponent <LayoutElement>();
     this.onValueChanged.AddListener(OnValueChanged);
 }
		protected override void Awake()
		{
			base.Awake();
			base.transition = Transition.None;
			base.toggleTransition = ToggleTransition.None;
			this.m_Accordion = this.gameObject.GetComponentInParent<Accordion>();
			this.m_RectTransform = this.transform as RectTransform;
			this.m_LayoutElement = this.gameObject.GetComponent<LayoutElement>();
			this.onValueChanged.AddListener(OnValueChanged);
		}
Пример #3
0
 static public int get_transition(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.Accordion self = (UnityEngine.UI.Extensions.Accordion)checkSelf(l);
         pushEnum(l, (int)self.transition);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #4
0
 static public int set_transitionDuration(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.Accordion self = (UnityEngine.UI.Extensions.Accordion)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.transitionDuration = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #5
0
        protected override void OnValidate()
        {
            base.OnValidate();
            this.m_Accordion = this.gameObject.GetComponentInParent <Accordion>();

            if (this.group == null)
            {
                ToggleGroup tg = this.GetComponentInParent <ToggleGroup>();

                if (tg != null)
                {
                    this.group = tg;
                }
            }

            LayoutElement le = this.gameObject.GetComponent <LayoutElement>();

            if (le != null && m_Accordion != null)
            {
                if (this.isOn)
                {
                    if (m_Accordion.ExpandVerticval)
                    {
                        le.preferredHeight = -1f;
                    }
                    else
                    {
                        le.preferredWidth = -1f;
                    }
                }
                else
                {
                    if (m_Accordion.ExpandVerticval)
                    {
                        le.preferredHeight = this.m_MinHeight;
                    }
                    else
                    {
                        le.preferredWidth = this.m_MinWidth;
                    }
                }
            }
        }