本文整理汇总了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
);
}
示例2: Awake
void Awake()
{
text = GetComponent<TextMesh>();
meshrenderer = GetComponent<MeshRenderer>();
meshrenderer.sortingLayerName = "ui";
meshrenderer.enabled = false;
}
示例3: Start
// Use this for initialization
void Start () {
buildSeq(nOpt);
timer = GameObject.Find ("Timer").GetComponent<TextMesh> ();
}
示例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;
}
示例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);
}
}
示例6: OnMouseEnter
void OnMouseEnter()
{
selected = true;
tm = GetComponent<TextMesh>();
startcolor = tm.color;
tm.color = Color.white;
}
示例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);
}
示例8: Start
void Start()
{
buttonText = GetComponentInChildren<TextMesh>();
gameMan = GameObject.FindGameObjectWithTag("Manager").GetComponent<GameManager>();
rend = GetComponent<Renderer>();
rend.material.SetColor("_Color", gameMan.pColor[playerNum]);
}
示例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;
}
示例10: Awake
void Awake()
{
this.myTextMesh = this.GetComponent<TextMesh>();
TransParentColor = this.myTextMesh.color;
TransParentColor.a = 0.0f;
}
示例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);
}
示例12: TextSize
public TextSize(TextMesh tm)
{
textMesh = tm;
renderer = tm.renderer;
dict = new Hashtable();
getSpace();
}
示例13: Start
// Use this for initialization
void Start()
{
if (course == null) {
course = (Course.CourseCounter)GameObject.FindWithTag("course").GetComponent<Course.CourseCounter>();
}
text = (TextMesh) GetComponent<TextMesh> ();
}
示例14: Start
void Start () {
textMesh = GetComponent<TextMesh>();
counter = 0;
damageCounter = 0;
lastHealth = 0;
currentHealth = 0;
}
示例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;
}