FairyGUI.GComponent.ApplyController C# (CSharp) Method

ApplyController() private method

private ApplyController ( FairyGUI.Controller c ) : void
c FairyGUI.Controller
return void
        internal void ApplyController(Controller c)
        {
            int cnt = _children.Count;
            for (int i = 0; i < cnt; ++i)
            {
                GObject child = _children[i];
                child.HandleControllerChanged(c);
            }
        }

Usage Example

        /// <summary>
        /// Set current page index, no onChanged event.
        /// 通过索引设置当前活动页面,和selectedIndex的区别在于,这个方法不会触发onChanged事件。
        /// </summary>
        /// <param name="value">Page index</param>
        public void SetSelectedIndex(int value)
        {
            if (_selectedIndex != value)
            {
                if (value > _pageIds.Count - 1)
                {
                    throw new IndexOutOfRangeException("" + value);
                }

                changing       = true;
                _previousIndex = _selectedIndex;
                _selectedIndex = value;
                parent.ApplyController(this);
                changing = false;
            }
        }
All Usage Examples Of FairyGUI.GComponent::ApplyController