本文整理汇总了C#中UILabel.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# UILabel.GetComponent方法的具体用法?C# UILabel.GetComponent怎么用?C# UILabel.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UILabel
的用法示例。
在下文中一共展示了UILabel.GetComponent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FadeInOut
IEnumerator FadeInOut(UILabel label, float time) {
//NGUITools.AddChild(label.gameObject);
TweenAlpha tween = label.GetComponent<TweenAlpha>();
tween.PlayForward();
yield return new WaitForSeconds(time);
tween.PlayReverse();
EventDelegate.Add(tween.onFinished, DestroyLabel);
}
示例2: Start
// Use this for initialization
void Start () {
r_LoadingScreen = gameObject.GetComponent( typeof( UISprite ) ) as UISprite;
if( r_LoadingScreen == null ){
Debug.LogError("Unable to find LoadingScreen");
} else {
r_LoadingScreenTweener = r_LoadingScreen.GetComponent( typeof( UITweener) ) as UITweener;
r_LoadingScreen.alpha = 1.0f;
StartCoroutine("fadeIn");
}
r_LoadingMessage = r_LoadingScreen.GetComponentInChildren( typeof (UILabel) ) as UILabel;
if( r_LoadingMessage == null ){
Debug.LogError("Unable to find LoadingMessage label");
} else {
r_LoadingMessageTweener = r_LoadingMessage.GetComponent( typeof( UITweener ) ) as UITweener;
}
}
示例3: Init
// Use this for initialization
public void Init (EntranceInfo mEntrance,FestivalUser data) {
currentPoint = 0;
entrance = mEntrance;
mState = FestivalUserState.FollowingDirection;
currentDirection = mEntrance.entranceDirection;
transform.up = currentDirection;
_Data = data;
followPoints = new List<Vector2> ();
InitLine ();
StartCoroutine ("FollowBehaviour");
mSkeletonAnimation.state.SetAnimation (0,_Data.animInfo.walk_anim, true);
nameLabel = (Instantiate (nameLabel_prefab) as GameObject).GetComponent<UILabel> ();
nameLabel.GetComponent<FollowPlayer> ().target = transform;
nameLabel.text = _Data.name;
controlState = UserControlState.Continue;
}
示例4: Highlight
/// <summary>
/// Visibly highlight the specified transform by moving the highlight sprite to be over it.
/// </summary>
void Highlight(UILabel lbl, bool instant)
{
if (mHighlight != null)
{
// Don't allow highlighting while the label is animating to its intended position
TweenPosition tp = lbl.GetComponent<TweenPosition>();
if (tp != null && tp.enabled) return;
mHighlightedLabel = lbl;
UIAtlas.Sprite sp = mHighlight.sprite;
float offsetX = sp.inner.xMin - sp.outer.xMin;
float offsetY = sp.inner.yMin - sp.outer.yMin;
Vector3 pos = lbl.cachedTransform.localPosition + new Vector3(-offsetX, offsetY, 0f);
if (instant || !isAnimated)
{
mHighlight.cachedTransform.localPosition = pos;
}
else
{
TweenPosition.Begin(mHighlight.gameObject, 0.1f, pos).method = UITweener.Method.EaseOut;
}
}
}
示例5: Highlight
/// <summary>
/// Visibly highlight the specified transform by moving the highlight sprite to be over it.
/// </summary>
void Highlight(UILabel lbl, bool instant)
{
if (mHighlight != null)
{
// Don't allow highlighting while the label is animating to its intended position
TweenPosition tp = lbl.GetComponent<TweenPosition>();
if (tp != null && tp.enabled) return;
mHighlightedLabel = lbl;
UISpriteData sp = mHighlight.GetAtlasSprite();
if (sp == null) return;
float scaleFactor = atlas.pixelSize;
float offsetX = sp.borderLeft * scaleFactor;
float offsetY = sp.borderTop * scaleFactor;
Vector3 pos = lbl.cachedTransform.localPosition + new Vector3(-offsetX, offsetY, 1f);
if (instant || !isAnimated)
{
mHighlight.cachedTransform.localPosition = pos;
}
else
{
TweenPosition.Begin(mHighlight.gameObject, 0.1f, pos).method = UITweener.Method.EaseOut;
}
}
}
示例6: disableCollider
// Disable single colldier
private void disableCollider(UILabel choice)
{
choice.GetComponent<BoxCollider> ().enabled = false;
}
示例7: enableCollider
// Enable single collider
private void enableCollider(UILabel choice)
{
choice.GetComponent<BoxCollider> ().enabled = true;
}
示例8: Highlight
private void Highlight(UILabel lbl, bool instant)
{
if (this.mHighlight != null)
{
TweenPosition component = lbl.GetComponent<TweenPosition>();
if (component != null && component.enabled)
{
return;
}
this.mHighlightedLabel = lbl;
UIAtlas.Sprite sprite = this.mHighlight.sprite;
float single = sprite.inner.xMin - sprite.outer.xMin;
float single1 = sprite.inner.yMin - sprite.outer.yMin;
Vector3 vector3 = lbl.cachedTransform.localPosition + new Vector3(-single, single1, 0f);
if (instant || !this.isAnimated)
{
this.mHighlight.cachedTransform.localPosition = vector3;
}
else
{
TweenPosition.Begin(this.mHighlight.gameObject, 0.1f, vector3).method = UITweener.Method.EaseOut;
}
}
}
示例9: Highlight
private void Highlight(UILabel lbl, bool instant)
{
if (this.mHighlight != null)
{
TweenPosition component = lbl.GetComponent<TweenPosition>();
if ((component == null) || !component.enabled)
{
this.mHighlightedLabel = lbl;
UISpriteData atlasSprite = this.mHighlight.GetAtlasSprite();
if (atlasSprite != null)
{
float pixelSize = this.atlas.pixelSize;
float num2 = atlasSprite.borderLeft * pixelSize;
float y = atlasSprite.borderTop * pixelSize;
Vector3 pos = lbl.cachedTransform.localPosition + new Vector3(-num2, y, 1f);
if (instant || !this.isAnimated)
{
this.mHighlight.cachedTransform.localPosition = pos;
}
else
{
TweenPosition.Begin(this.mHighlight.gameObject, 0.1f, pos).method = UITweener.Method.EaseOut;
}
}
}
}
}