ApplyController() private method

private ApplyController ( FairyGUI.Controller c ) : void
c FairyGUI.Controller
return void
        /// <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;
            }
        }
Ejemplo n.º 2
0
		/// <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);

				_previousIndex = _selectedIndex;
				_selectedIndex = value;
				parent.ApplyController(this);

				if (_playingTransition != null)
				{
					_playingTransition.Stop();
					_playingTransition = null;
				}
			}
		}