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


C# UILabel.GetComponent方法代码示例

本文整理汇总了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);
	}
开发者ID:RobbSteel,项目名称:Lords-of-Distortion,代码行数:8,代码来源:HUDTools.cs

示例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;
		}
	}
开发者ID:Backman,项目名称:Hellbound,代码行数:18,代码来源:LoadingLogic.cs

示例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;
	}
开发者ID:Bimehackaton,项目名称:proyecto-6,代码行数:20,代码来源:FestivalUserBehaviour.cs

示例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;
            }
        }
    }
开发者ID:shinobushiva,项目名称:Perfume-Unity,代码行数:29,代码来源:UIPopupList.cs

示例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;
            }
        }
    }
开发者ID:TomMulvaney,项目名称:JoyGatsby_Runner,代码行数:32,代码来源:UIPopupList.cs

示例6: disableCollider

	// Disable single colldier
	private void disableCollider(UILabel choice)
	{
		choice.GetComponent<BoxCollider> ().enabled = false;
	}
开发者ID:JohnMai,项目名称:WhiteSharks,代码行数:5,代码来源:DialogueGUI_Test.cs

示例7: enableCollider

	// Enable single collider
	private void enableCollider(UILabel choice)
	{
		choice.GetComponent<BoxCollider> ().enabled = true;
	}
开发者ID:JohnMai,项目名称:WhiteSharks,代码行数:5,代码来源:DialogueGUI_Test.cs

示例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;
         }
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:24,代码来源:UIPopupList.cs

示例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;
                 }
             }
         }
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:27,代码来源:UIPopupList.cs


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