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


C# Text.GetComponent方法代码示例

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


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

示例1: Start

	// Use this for initialization
	//void Start () {
	    
	//}
    void Start()
    {
        
       icon =  PlayerUIMgr.instance.AddHunterIcon();
       icon.GetComponent<BoundObject>().SetBoundTranform(this.transform);
       //icon.onClick.AddListener(this.GetComponent<NvigationGame>().Select);
       
        hunter_nav = this.GetComponent<NvigationGame>();

       name_text = PlayerUIMgr.instance.AddText();
       name_text.GetComponent<BoundObject>().SetBoundTranform(this.transform);
       name_text.GetComponent<BoundObject>().SetGap(new Vector2(0,20));
       hunter_name_ui = HunterListPanel.instance.AddHunterName("hunter1");
       hunter_name_ui.hunter = this;

       SetName("hunter1");

       icon.GetComponent<HunterUI>().hunter = this;
       floor_mask = 1 << 8 + 1 << 9 + 1 << 10;

       my_agent = this.transform.parent.GetComponent<NavMeshAgent>();

        //追跡フラッグをoff
       target = null;
       
        
    }
开发者ID:FairyHamaLab,项目名称:Desertion,代码行数:31,代码来源:Hunter.cs

示例2: FadeTextIn

    public IEnumerator FadeTextIn(Text textToFade)
    {
        float alpha = textToFade.GetComponent<Text>().color.a;

        for (float i = 0f; i < 1f; i += Time.deltaTime / aTime)
        {
            Color newColor = textToFade.GetComponent<Text>().color;
            newColor.a = Mathf.Lerp(alpha, 1, i);
            textToFade.GetComponent<Text> ().color = newColor;
            yield return null;
        }
    }
开发者ID:chocobo555,项目名称:WolfWoman,代码行数:12,代码来源:Fader.cs

示例3: Start

    void Start()
    {
        tempCol = new Color(255, 255, 255, 0);

        if(gameOverText != null)
        {
            victoryText = gameOverText.GetComponent<Text>();
            //victoryText.enabled = false;
            victoryOutline = victoryText.GetComponent<Outline>();
            victoryShadow = victoryText.GetComponent<Shadow>();
        }
    }
开发者ID:Digitalistic,项目名称:SuperTropicalActionBoating64,代码行数:12,代码来源:checkpoint.cs

示例4: FadeTextOut

    public IEnumerator FadeTextOut(Text textToFade)
    {
        float alpha = textToFade.GetComponent<Text>().color.a;

        float t = 0;
        for (float i = 1f; i > 0f; i -= Time.deltaTime / aTime)
        {
            t += Time.deltaTime / aTime;

            Color newColor = textToFade.GetComponent<Text>().color;
            newColor.a = Mathf.Lerp(alpha, 0, t);
            textToFade.GetComponent<Text>().color = newColor;
            yield return null;
        }
    }
开发者ID:chocobo555,项目名称:WolfWoman,代码行数:15,代码来源:Fader.cs

示例5: createOrders

    //look at the current order list and make a Text for each
    public void createOrders()
    {
        int iCount = 0;
        foreach(Item i in orders.Keys){

            //making the order
            orderEntry = (Text)Instantiate(orderPrefab);
            orderEntry.name = i.getName(); //name the object
            int qty = orders[i];
            string temp = "x"+qty;
            temp+= " "+i.getName();
            orderEntry.text = temp; //assign the text

            priceField = orderEntry.transform.Find("Price").gameObject.GetComponent<Text>(); //find the Price-text child
            priceField.text = (qty*i.getPrice()).ToString("C");

            //positioning the order
            orderEntry.transform.SetParent(this.gameObject.transform); //make position relative to the orderview
            orderEntry.transform.localScale = Vector2.one;//this line stops the text from being huge
            orderEntry.GetComponent<RectTransform>().localPosition = new Vector2(50, y-(iCount*itemHt));
            iCount++;
        }

        if ((y - itemHt*iCount) < -maxHeight)
            contentPane.sizeDelta = new Vector2 (980, (-y + itemHt*iCount));
        else
            contentPane.sizeDelta = new Vector2 (980, maxHeight);
        updatePrice ();
    }
开发者ID:AshBlankets,项目名称:PlaceMapp,代码行数:30,代码来源:OrderPage.cs

示例6: fillText

  void fillText(string what, Text heading, Text contents) {
    heading.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, - accumulatedHeight);
    accumulatedHeight += heading.preferredHeight + spaceBetweenHeadingAndContents;
    contents.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, - accumulatedHeight);

    string data = Resources.Load("_StatsMatching/" + what).ToString().Trim();
    string[] lines = data.Split('\n');
    foreach (string line in lines) {
      string[] lineData = line.Split(',');
      string value = getValue(lineData);
      contents.text += lineData[2] + ": " + value + "\n";
    }
    contents.text = contents.text.Trim();
    accumulatedHeight += contents.preferredHeight + spaceBetweenCategories;
    contents.GetComponent<RectTransform>().sizeDelta = new Vector2(newWidth, contents.preferredHeight);
  }
开发者ID:spilist,项目名称:shoong,代码行数:16,代码来源:ShowStats.cs

示例7: Start

    // Use this for initialization
    void Start() {
		gameManager = GameObject.Find ("GameManager").GetComponent<Manager> ();
		distance = GameObject.Find ("DistanceToHole").GetComponent<Text> ();
		score = GameObject.Find ("Score").GetComponent<Text> ();
		name = GameObject.Find ("Name").GetComponent<Text> ();
		powerbar = GameObject.Find ("PowerSlider").GetComponent<Slider> ();
		gameManager.scoreboard = GameObject.Find ("Leaderboard").GetComponent<Leaderboard> ();

        distance.GetComponent<Text>().text = "Distance To Hole:" + distanceToHole;
        score.GetComponent<Text>().text = "Strokes:" + strokes;
		name.GetComponent<Text> ().text = PlayerPrefs.GetString("playerName");

		//Setup powerbar values
		powerbar.minValue = minHitPower;
		powerbar.maxValue = maxHitPower;

		//Ball pointer display
		ballPointer.SetActive (true);


		scoreTotal = PlayerPrefs.GetInt("totalScore");
		gameManager.scoreboard.updateLeaderboard (gameManager.getCurrentLevel(), strokes, scoreTotal);

		Debug.Log ("Beginning of level total: " + scoreTotal);
		//Debug.Log ("Hole Y Position: " + hole.transform.position.y);
		//Debug.Log ("Hole X Position: " + hole.transform.position.x);
    }
开发者ID:Shane-E,项目名称:MiniGolfWorld,代码行数:28,代码来源:Golfball.cs

示例8: Awake

	public void Awake() {
		canvasGroupObj = new GameObject ("CanvasGroup");
		canvasGroupObj.transform.SetParent(gameObject.transform, false);
		canvasGroupObj.AddComponent<CanvasGroup>();
		canvasGroupObj.transform.localRotation = 
			Quaternion.FromToRotation(Vector3.forward, Vector3.down);
		
		canvasGroupObj.transform.localScale = Vector3.one * 0.002f;
		
		/*******************************************************/
		
		canvasObj = new GameObject ("Canvas");
		canvasObj.transform.SetParent (canvasGroupObj.transform, false);
		
		Canvas canvas = canvasObj.AddComponent<Canvas> ();
		canvas.renderMode = RenderMode.WorldSpace;
		
		canvasObj.GetComponent<RectTransform>().pivot = new Vector2(0.5f, 0.5f);
		/*********************************************************/
		
		textObj = new GameObject ("Text");
		textObj.transform.SetParent (canvasObj.transform, false);
		
		_text = textObj.AddComponent<Text> ();
		
		_text.GetComponent<Text> ().alignment = TextAnchor.MiddleCenter;
		
		/*********************************************************/
		
		//_text.material = ShortcutUtil.GetMaterial ();
		_text.material = Materials.GetTextLayer (_text.material, 1);
		/*********************************************************/
		
	}
开发者ID:honi90,项目名称:LeapMotionVRInterface,代码行数:34,代码来源:UIHasChild.cs

示例9: Start

    private RigidBodyControls player; //Referance to the player

    #endregion Fields

    #region Methods

    void Start()
    {
        player = GetComponent<RigidBodyControls>();
        playerNumber = GetComponent<playerCharacter> ().ID;
        // Not the best way of doing this, but couldn't think of a clean, fast, robust way, that also accounted for
        // possible null refs if it tried to find the player before they spawned in
        if(playerNumber == 1)
        {
            dash = GameObject.Find("Txt_p1_Dashes").GetComponent<Text>();
            dash.GetComponent<Text>().enabled = true;
        }
        else if(playerNumber == 2)
        {
            dash = GameObject.Find("Txt_p2_Dashes").GetComponent<Text>();
            dash.GetComponent<Text>().enabled = true;
        }
        else if(playerNumber == 3)
        {
            dash = GameObject.Find("Txt_p3_Dashes").GetComponent<Text>();
            dash.GetComponent<Text>().enabled = true;
        }
        else
        {
            dash = GameObject.Find("Txt_p4_Dashes").GetComponent<Text>();
            dash.GetComponent<Text>().enabled = true;
        }
    }
开发者ID:KeiranG19,项目名称:Straypunch-Studios,代码行数:33,代码来源:dashes.cs

示例10: Awake

//===========================================================
// 関数定義
//===========================================================
	//---------------------------------------------------
	// コンストラクタ
	//---------------------------------------------------
	void Awake()
	{
		m_CellList	= new List<CZParamCell>();
		m_ColName	= transform.FindChild("InputName").FindChild("Text").GetComponent<Text>();
		m_SelType	= transform.FindChild("SelType").GetComponent<Dropdown>();

		m_vColSize	= m_ColName.GetComponent<RectTransform>().sizeDelta;
	}
开发者ID:Noirand,项目名称:ParamEditor,代码行数:14,代码来源:CZColumnHeader.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     nameHolder = Instantiate(namePref);
     nameHolder.GetComponent<Text>().text = objName;
     nameHolder.transform.parent = GameObject.Find("Canvas").transform;
     valHolder = Instantiate(valPref);
     valHolder.GetComponent<Text>().text = value;
     valHolder.transform.parent = GameObject.Find("Canvas").transform;
 }
开发者ID:jphacks,项目名称:TK_19,代码行数:10,代码来源:include.cs

示例12: Awake

	public void Awake()
	{
		opcionesUIJuego = GameCenter.InstanceRef.CanvasUIJuego.GetComponent<OpcionesCanvasUIJuego> ();
		textoLateral = opcionesUIJuego.panelLateral.GetComponentInChildren<Text>();
		textoLateralOpciones = textoLateral.GetComponent<TextoLateralOpciones> ();
		textoInferior = opcionesUIJuego.panelInferior.GetComponentInChildren<Text>();
		textoInferiorOpciones = textoInferior.GetComponent<TextoInferiorOpciones> ();
		panelPreguntasOpciones = GameObject.Find ("PanelPreguntas").GetComponent<PanelPreguntasOpciones> ();
		listaPreguntas = opcionesUIJuego.panelInferior.GetComponentInChildren<ScrollRect> ().GetComponent<ListaPreguntas> ();
		panelObjetosOpciones = opcionesUIJuego.panelObjetos.GetComponent<PanelObjetosOpciones> ();
		imagenCargando = opcionesUIJuego.imagenCargando.GetComponent<PantallaCarga> ();
	}
开发者ID:jferranm,项目名称:oscuridad,代码行数:12,代码来源:ControladoraGUI.cs

示例13: PlayFloatingTextAnimation

	private IEnumerator PlayFloatingTextAnimation(Text t, int damageAmount) {
		if (t == null) {
			yield break;
		}

		t.text = damageAmount.ToString();
		t.enabled = true;

		//TODO: optimize
		Animator a = t.GetComponent<Animator>();
		a.Play("TextFloat" + Random.Range(1, _textAnimationsCount + 1), 0, 0);
		yield return null;
		yield return new WaitForSeconds(a.GetCurrentAnimatorStateInfo(0).length);

		t.enabled = false;
	}
开发者ID:UpdateShu,项目名称:ForceFury_Unity5,代码行数:16,代码来源:UnitUI.cs

示例14: Awake

    public void Awake()
    {
        imagenCargando = GameObject.Find ("ImagenCargando");
        panelLateral = GameObject.Find ("PanelLateral");
        panelInferior = GameObject.Find ("PanelInferior");
        botonDiario = GameObject.Find ("BotonDiario");
        panelDirecciones = GameObject.Find ("PanelDirecciones");
        panelObjetos = GameObject.Find ("PanelObjetos");
        panelLibro = GameObject.Find ("Libro");

        textoLateral = panelLateral.GetComponentInChildren<Text>();
        textoLateralOpciones = textoLateral.GetComponent<TextoLateralOpciones> ();
        textoInferior = panelInferior.GetComponentInChildren<Text>();
        textoInferiorOpciones = textoInferior.GetComponent<TextoInferiorOpciones> ();
        panelPreguntasOpciones = GameObject.Find ("PanelPreguntas").GetComponent<PanelPreguntasOpciones> ();
        listaPreguntas = panelInferior.GetComponentInChildren<ScrollRect> ().GetComponent<ListaPreguntas> ();
        panelObjetosOpciones = panelObjetos.GetComponent<PanelObjetosOpciones> ();
    }
开发者ID:chris31416,项目名称:oscuridad,代码行数:18,代码来源:ControladoraGUI.cs

示例15: Glow

 public static IEnumerator Glow(Text text)
 {
     Outline outline = text.GetComponent<Outline>();
     if (outline != null) {
         outline.enabled = true;
         for (int i = 0; i<12; i++) {
             outline.effectDistance += Vector2.one * .25f;
             yield return new WaitForSeconds(.04f);
         }
         for (int i = 0; i<10; i++) {
             outline.effectDistance -= Vector2.one * .3f;
             yield return new WaitForSeconds(.1f);
         }
         outline.effectDistance = Vector2.zero;
         outline.enabled = false;
     }
     yield return null;
 }
开发者ID:unclehighbrow,项目名称:Math-Is-Stupid,代码行数:18,代码来源:Util.cs


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