当前位置: 首页>>代码示例>>C#>>正文


C# UIScrollView.GetComponent方法代码示例

本文整理汇总了C#中UIScrollView.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# UIScrollView.GetComponent方法的具体用法?C# UIScrollView.GetComponent怎么用?C# UIScrollView.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIScrollView的用法示例。


在下文中一共展示了UIScrollView.GetComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitGrid

        /// <summary>
        /// Cache the scroll view and return 'false' if the scroll view is not found.
        /// </summary>
        public void InitGrid() {
            mTrans = transform;
            mPanel = NGUITools.FindInParents<UIPanel>(gameObject);
            mScroll = mPanel.GetComponent<UIScrollView>();

            if (mScroll != null) {
                mScroll.GetComponent<UIPanel>().onClipMove = OnMove;
            }

            mChildren.Clear();
            for (int i = 0; i < mTrans.childCount; ++i)
                mChildren.Add(mTrans.GetChild(i));

            // Sort the list of children so that they are in order
            mChildren.Sort(UIGrid.SortByName);

            if (mScroll == null) return;
            if (mScroll.movement == UIScrollView.Movement.Horizontal) mHorizontal = true;
            else if (mScroll.movement == UIScrollView.Movement.Vertical) mHorizontal = false;

            WrapContent();
        }
开发者ID:zhangf911,项目名称:SimpleFramework_NGUI,代码行数:25,代码来源:WrapGrid.cs

示例2: leftShiftScrollView

 public static void leftShiftScrollView(UIScrollView scrollView, UIGrid grid)
 {
     float weight = grid.cellWidth;
     Vector3 currentPosition = scrollView.transform.localPosition;
     float maxWeight = (grid.GetChildList().Count) * grid.cellWidth / 2;
     scrollView.transform.localPosition = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
     scrollView.GetComponent<UIPanel>().clipOffset = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
 }
开发者ID:xiaozhuzhaoge,项目名称:Universal-Space,代码行数:8,代码来源:UISystem.cs

示例3: Start

	// Use this for initialization
	void Start ()
	{
		_swipeState = SwipeState.None;

		_isFirstTouch = true;

		_uiScrollView = GetComponentInChildren<UIScrollView>();

		if (null == _uiScrollView)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIScrollView component for _uiScrollView");
		}

		_startingMomentum = _uiScrollView.momentumAmount;
		_uiScrollView.panel.clipping = UIDrawCall.Clipping.None;

		_panel = _uiScrollView.GetComponent<UIPanel>();

		if (null == _panel)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIPanel component for _panel");
		}

		DynamicScrollView2 dynamicScrollView = FindObjectOfType<DynamicScrollView2>();

		if (null == dynamicScrollView)
		{
			throw new NullReferenceException("TestSwipeScripts.Start - can't find DynamicScrollView object");
		}

		_thresholdDistanceToCloseCard = dynamicScrollView.closeDetailCardThresholdHorizontal;
		_thresholdDistanceVerticalToCloseCard = dynamicScrollView.closeDetailCardThreshold;


		ScrollViewContainer = NGUITools.FindInParents<UIWidget>(_uiScrollView.transform);

		if (null == ScrollViewContainer)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIWidget component for _scrollViewContainer");
		}

		_currentScale = Vector3.one;

		_previousMovementState = UIScrollView.Movement.Custom;

	}
开发者ID:odasaburo,项目名称:ActiveLife,代码行数:47,代码来源:SwipeScripts.cs


注:本文中的UIScrollView.GetComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。