12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using UnityEngine;
- using System.Collections;
- namespace TMPro.Examples
- {
-
- public class Benchmark03 : MonoBehaviour
- {
- public int SpawnType = 0;
- public int NumberOfNPC = 12;
- public Font TheFont;
-
- void Awake()
- {
- }
- void Start()
- {
- for (int i = 0; i < NumberOfNPC; i++)
- {
- if (SpawnType == 0)
- {
-
-
- GameObject go = new GameObject();
-
- go.transform.position = new Vector3(0, 0, 0);
-
-
-
- TextMeshPro textMeshPro = go.AddComponent<TextMeshPro>();
-
- textMeshPro.alignment = TextAlignmentOptions.Center;
- textMeshPro.fontSize = 96;
- textMeshPro.text = "@";
- textMeshPro.color = new Color32(255, 255, 0, 255);
-
-
-
-
- }
- else
- {
-
- GameObject go = new GameObject();
-
- go.transform.position = new Vector3(0, 0, 0);
- TextMesh textMesh = go.AddComponent<TextMesh>();
- textMesh.GetComponent<Renderer>().sharedMaterial = TheFont.material;
- textMesh.font = TheFont;
- textMesh.anchor = TextAnchor.MiddleCenter;
- textMesh.fontSize = 96;
- textMesh.color = new Color32(255, 255, 0, 255);
- textMesh.text = "@";
-
-
-
- }
- }
- }
- }
- }
|