using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class 生成文字 : MonoBehaviour
{
public GameObject 预制体Text;
public Transform 父物体Text;
public string text;
private GameObject Text;
// Start is called before the first frame update
void Start()
{
Text = Instantiate(预制体Text,父物体Text);
Text.GetComponent<Text>().text = text;
}
// Update is called once per frame
void Update()
{
Vector2 新的屏幕坐标 = Camera.main.WorldToScreenPoint(this.transform.position );
Text.transform.position = 新的屏幕坐标;
}
}