Ejemplo 1: cambiar textmesh pro text
using UnityEngine;
using System.Collections;
using TMPro;
public class ExampleClass : MonoBehaviour
{
void Example()
{
TextMeshPro textmeshPro = GetComponent<TextMeshPro>();
textmeshPro.SetText("The first number is {0} and the 2nd is {1:2} and the 3rd is {3:0}.", 4, 6.345f, 3.5f);
// The text displayed will be:
// The first number is 4 and the 2nd is 6.35 and the 3rd is 4.
}
}
Ejemplo 2: obtener el componente text mesh pro
GetComponent<TMPro.TextMeshProUGUI>().text
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)