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


C# UnityEngine.TextMesh类代码示例

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


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


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