本文整理汇总了C#中UIPanel.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# UIPanel.GetComponent方法的具体用法?C# UIPanel.GetComponent怎么用?C# UIPanel.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIPanel
的用法示例。
在下文中一共展示了UIPanel.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();
}
示例2: CacheScrollView
/// <summary>
/// Cache the scroll view and return 'false' if the scroll view is not found.
/// </summary>
protected bool CacheScrollView ()
{
mTrans = transform;
mPanel = NGUITools.FindInParents<UIPanel>(gameObject);
mScroll = mPanel.GetComponent<UIScrollView>();
if (mScroll == null) return false;
if (mScroll.movement == UIScrollView.Movement.Horizontal) mHorizontal = true;
else if (mScroll.movement == UIScrollView.Movement.Vertical) mHorizontal = false;
else return false;
return true;
}
示例3: StartTween
bool StartTween(UIPanel go, Vector3 from, Vector3 to)
{
if (go == null) return false;
TweenScale tweenScale = go.GetComponent<TweenScale>();
if (tweenScale != null)
{
tweenScale.from = from;
tweenScale.to = to;
tweenScale.ResetToBeginning();
tweenScale.enabled = true;
}
return true;
}