• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UnityEngine.TextMesh类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UnityEngine.TextMesh的典型用法代码示例。如果您正苦于以下问题:C# TextMesh类的具体用法?C# TextMesh怎么用?C# TextMesh使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextMesh类属于UnityEngine命名空间,在下文中一共展示了TextMesh类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FadeIn

    private IEnumerator FadeIn(TextMesh m)
    {
        float timeCounter = 0f;

        float fadeAwayTimeout = 1f;

        while (timeCounter < fadeAwayTimeout){

            float alpha = (1f * (timeCounter / fadeAwayTimeout));

            m.color = new Color(
                m.color.r,
                m.color.g,
                m.color.b,
                (alpha > 0) ? alpha : 0f
                );

            timeCounter += Time.deltaTime;

            yield return 0;
        }

        m.color = new Color(
            m.color.r,
            m.color.g,
            m.color.b,
            1f
            );
    }
开发者ID:kjuik,项目名称:ChainJam2014,代码行数:29,代码来源:Choice.cs


示例2: Awake

 void Awake()
 {
     text = GetComponent<TextMesh>();
     meshrenderer = GetComponent<MeshRenderer>();
     meshrenderer.sortingLayerName = "ui";
     meshrenderer.enabled = false;
 }
开发者ID:krylorz,项目名称:New-Space-Scavs-Repo,代码行数:7,代码来源:CarryableText.cs


示例3: Start

	// Use this for initialization
	void Start () {

        buildSeq(nOpt);

		timer = GameObject.Find ("Timer").GetComponent<TextMesh> ();

	}
开发者ID:s1vh,项目名称:GGJ16,代码行数:8,代码来源:Level1.cs


示例4: Start

    // Use this for initialization
    void Start()
    {
        score = ScoreWorker.score;

        ResultLabel = GameObject.Find ("Score").GetComponent<TextMesh> ();
        DescLabel =   GameObject.Find ("Description").GetComponent<TextMesh> ();

        timer = (float)1.9;
        is_wait = true;

        int curr_max_score = 0;

        string r = Keeper.get_param ("MaxScore");

        curr_max_score = Convert.ToInt32 (r);

        if (curr_max_score < score)
        {
            curr_max_score = score;
        }

        Keeper.set_param ("MaxScore", Convert.ToString (curr_max_score));

        best_record =  Convert.ToInt32(Keeper.get_param ("MaxScore"));

        //best_record = Convert.ToInt32 (max_score);
        //best_record = max_score;
    }
开发者ID:Lintoo-Dev,项目名称:HappyGameTest-4,代码行数:29,代码来源:ShowResults.cs


示例5: CheckTerminals

    private IEnumerator CheckTerminals()
    {
        while (enabled)
        {
            IsNextToGenerator = false;
            IsNextToTerminal = false;
            foreach (Transform t in this.transform)
            {
                //print("distance of " + Vector3.Distance(Character.position, t.position));
                if (Vector3.Distance(Character.position, t.position) < TerminalDistance)
                {
                    if (t.name.ToLower().StartsWith("o2gen"))
                    {
                        IsNextToGenerator = true;
                        GeneratorName = t.name;
                        break;
                    }
                    else
                    {
                        IsNextToTerminal = true;
                        currentLabel = t.GetChild(0).GetComponent<TextMesh>();

                        EnumExtensions.TryParse<Terminal.TerminalType>(CurrentTerminalType, t.name.ToLower(), out CurrentTerminalType);
                        break;
                    }
                }
            }

            yield return new WaitForSeconds(.5f);
        }
    }
开发者ID:HarmonicOrder,项目名称:WarpedDrive,代码行数:31,代码来源:TerminalManager.cs


示例6: OnMouseEnter

 void OnMouseEnter()
 {
     selected = true;
     tm = GetComponent<TextMesh>();
     startcolor = tm.color;
     tm.color = Color.white;
 }
开发者ID:TheFatCat,项目名称:Castaway,代码行数:7,代码来源:SelectableObject.cs


示例7: Start

	/*public PlayerHandler(int lvl, float ex, float health, float magic, string n){
		level = lvl;
		exp = ex;
		hp = health;
		mp = magic;
		playerName = n;
	}*/
	void Start(){
		nameMesh = GetComponentInChildren<TextMesh> ();
		nameMesh.text = Name;
		SetHpToMax ();
		SetMpToMax ();
		GM().setPos (this.gameObject);
	}
开发者ID:KingCrazy,项目名称:Relentless,代码行数:14,代码来源:EnemyHandler.cs


示例8: Start

 void Start()
 {
     buttonText = GetComponentInChildren<TextMesh>();
     gameMan = GameObject.FindGameObjectWithTag("Manager").GetComponent<GameManager>();
     rend = GetComponent<Renderer>();
     rend.material.SetColor("_Color", gameMan.pColor[playerNum]);
 }
开发者ID:izzy-sabur,项目名称:polish_proj,代码行数:7,代码来源:CharacterDisplay.cs


示例9: OnEnable

        void OnEnable()
        {
            foreach(Transform child in transform)
            {
                //Search for child Loading Background to get the mesh renderer for the background texture
                if(child.name == "Loading Background")
                {
                    m_MeshRenderer = child.GetComponent<MeshRenderer>();
                }
                if(child.name == "Loading Percent")
                {
                    m_LoadingText = child.GetComponent<TextMesh>();
                }
            }

            if(m_MeshRenderer == null)
            {
                Debug.LogError("Missing a gameobject with the name \'Loading Background\' and a \'MeshRenderer\' component.");
                gameObject.SetActive(false);
                return;
            }
            if(m_LoadingText == null)
            {
                Debug.LogError("Missing a gameobject with the name \'Loading Text\' and a \'TextMesh\' component.");
                gameObject.SetActive(false);
                return;
            }
            Material material = new Material(m_MeshRenderer.sharedMaterial);
            material.SetTexture("_MainTex", m_TextureToDisplay);
            m_MeshRenderer.material = material;
        }
开发者ID:NathanSaidas,项目名称:OnLooker_Unity,代码行数:31,代码来源:LoadScreen.cs


示例10: Awake

    void Awake()
    {
        this.myTextMesh = this.GetComponent<TextMesh>();

        TransParentColor = this.myTextMesh.color;
        TransParentColor.a = 0.0f;
    }
开发者ID:MasatomoSegawa,项目名称:Life30,代码行数:7,代码来源:Quest.cs


示例11: Awake

	void Awake () {
    if (textAsset == null)
      return;

    string text = textAsset.text;
    text = text.Replace("\\n", System.Environment.NewLine);

    textAsset = null; // Required otherwise the clone will instantiate other clones
    GameObject clone = Instantiate(gameObject) as GameObject;
    TextMesh clone_text_mesh = clone.GetComponent<TextMesh>();

    string[] parts = text.Split(' ');
    text = "";
    string line = "";
    for (int i = 0; i < parts.Length; ++i)
    {
      clone_text_mesh.text = line + parts[i];
      if (clone_text_mesh.renderer.bounds.extents.x > maxWidth)
      {
        text += line.TrimEnd() + System.Environment.NewLine;
        line = "";
      }
      line += parts[i] + " ";
    }
    text += line.TrimEnd();

    text_mesh_ = GetComponent<TextMesh>();
    text_mesh_.text = text;

    Destroy(clone);
	}
开发者ID:Nindustrialist,项目名称:VRBreadboarding,代码行数:31,代码来源:TextMeshWordWrapper.cs


示例12: TextSize

 public TextSize(TextMesh tm)
 {
     textMesh = tm;
     renderer = tm.renderer;
     dict = new Hashtable();
     getSpace();
 }
开发者ID:phoenixperry,项目名称:NYHS_1,代码行数:7,代码来源:TextSize.cs


示例13: Start

 // Use this for initialization
 void Start()
 {
     if (course == null) {
         course = (Course.CourseCounter)GameObject.FindWithTag("course").GetComponent<Course.CourseCounter>();
     }
     text = (TextMesh) GetComponent<TextMesh> ();
 }
开发者ID:ramsesoriginal,项目名称:GlitchGlider,代码行数:8,代码来源:Score.cs


示例14: Start

	void Start () {
		textMesh = GetComponent<TextMesh>();
		counter = 0;
		damageCounter = 0;
		lastHealth = 0;
		currentHealth = 0;
	}
开发者ID:shingokko,项目名称:combocannon,代码行数:7,代码来源:PlayerHealthBar.cs


示例15: Init

    public void Init(string s)
    {
        animation = GetComponent<VillagerAnimation>();
		animation.Init (s);

        skinMaterial = GetComponentInChildren<MeshRenderer>().material;
        origColor = skinMaterial.color;

        // music stuff
        musicToggle = GetComponent<ToggleSuspend>();
        musicPattern = GetComponent<Pattern>();
        SetMusicPattern();
        musicSample = GetComponent<Sampler>();
        SetMusicSample();

		keyboardPosition = transform.localPosition;

        textMesh = GetComponentInChildren<TextMesh>();

        letter = s;
        textMesh.text = s;

		currentState = State.Idle;
		timeSinceLastDanced = Time.time;
    }
开发者ID:tylerjhutchison,项目名称:RitualVillage,代码行数:25,代码来源:Villager.cs


示例16: Start

	// Use this for initialization
	private void Start ()
	{
		_dieTimer 	= new Timer(_duration);
		_text 		= GetComponent<TextMesh>();

		_dieTimer.Start();
	}
开发者ID:emilienregent,项目名称:ggj2016,代码行数:8,代码来源:InGameText.cs


示例17: Start

	void Start ()
	{
		slot1Data = transform.Find ("slot01").transform.Find ("data").gameObject.GetComponent<TextMesh>();
		slot1Text = transform.Find ("slot01").transform.Find ("text").gameObject.GetComponent<GameTextControl>();

		slot2Data = transform.Find ("slot02").transform.Find ("data").gameObject.GetComponent<TextMesh>();
		slot2Text = transform.Find ("slot02").transform.Find ("text").gameObject.GetComponent<GameTextControl>();

		slot3Data = transform.Find ("slot03").transform.Find ("data").gameObject.GetComponent<TextMesh>();
		slot3Text = transform.Find ("slot03").transform.Find ("text").gameObject.GetComponent<GameTextControl>();

		if(int.TryParse(LevelControl.CURRENT_LEVEL_CLASS.myName, out levelValue))
		{
			titleText = transform.Find ("levelTitle").transform.Find ("title").gameObject.GetComponent<GameTextControl>();

			if(LevelControl.CURRENT_LEVEL_CLASS.type == 0)
			{
				titleText.myKey = "ui_sign_mission";
				titleText.addText = " " + levelValue.ToString();
			}
			else if(LevelControl.CURRENT_LEVEL_CLASS.type == 1)
			{
				titleText.myKey = "ui_sign_bonus_mission";
				titleText.addText = " " + levelValue.ToString();
			}
		}
		//

		slot1Data.text = LevelControl.CURRENT_LEVEL_CLASS.movesLimitForStar.ToString();

		slot2Data.text = TimeScaleManager.getTimeString ((int) LevelControl.CURRENT_LEVEL_CLASS.timeLimitForStar);

		slot3Data.text = LevelControl.CURRENT_LEVEL_CLASS.scoreLimitForStar.ToString();

	}
开发者ID:rtumelty,项目名称:ridiculousrescue,代码行数:35,代码来源:RestartedBriefScreenControl.cs


示例18: Start

    void Start()
    {
        roundDisplayMesh = gameObject.GetComponent<TextMesh>();

        currRound = 1;
        roundDisplayMesh.text = "Round: " + currRound.ToString();
    }
开发者ID:poudigne,项目名称:2DSpacePlatformer,代码行数:7,代码来源:RoundWatcher.cs


示例19: Start

 // Use this for initialization
 void Start()
 {
     f_Timer = 5f;
     i_Score = 0;
     i_HighScore = GameData.i_HighScore;
     TEXTDISPLAY = GetComponent<TextMesh>();
 }
开发者ID:Auranapse,项目名称:Scrubity-UI,代码行数:8,代码来源:ScoreHandler.cs


示例20: Start

	//public static bool fade = false;
	void Start () {
		fade = false;
		anim = GetComponent<Animator>();
		spr = GetComponent<SpriteRenderer>();
		T = GetComponent<TextMesh>();
		//		spr.color = Color.red;
		//		Debug.Log(spr.color);
		//gameObject.GetComponent<Rigidbody2D>().simulated = false;
		instructions = new string[]{
			"Welcome to the quantum world. Things behave very differently here.", 
			"This is an electron in its wave state...",
			"To see the electron in its particle state, we need to take measurements. At each measurement we can see where the electron had been.",
			"Notice that the electron only appears along the wire. That's because this is a 1-D quantum wire. This also means you can't jump.",
			"Let's speed things up a little and see where the electron occurs most.",//4
			"The maximum amplitude of the wave at any point tells us the probability of finding the electron there.",
			"So at all times, the electron has the highest chance of being found in the middle...",
			"...and the least chance at the ends.",//7
			"The shape of the wave function is determined by the potential profile. We will discuss this in a later level.",
			"The electron's Total Energy is quantized in this world, which means it can only have discrete values.",
			"The electron is currently on the ground state (Energy Level 0).",//10
			"These are sources of light. When brought to a light machine, they emit photons. Photons can give energy to the electron.",//11
			"The color of a photon determines its energy. Lower wavelength (like blue and violet) means higher energy and vice-versa.",
			"Only the correct energy photon can change the electon's energy level. Bring the light sources in the right order to the light machine.",
			"The Total Energy has increased. The wavefunction changes for each energy level, so it now looks different.",//14
			"It now has a node, a point where there is no chance of the electron appearing. The number of nodes is equal to the energy level number.",
			"Get the remaining photons to finish the level. Press next to play."," "};

		T.text = instructions[tutorialManagerQ.i];
		T.text = ResolveTextSize(T.text,length);
		//Debug.Log(T.text);
		
	}
开发者ID:aanupam3,项目名称:PIAB-Unity-master,代码行数:33,代码来源:textQ.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.Texture类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.TextAsset类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap