【发布时间】:2019-05-25 22:29:58
【问题描述】:
我正在尝试团结一致,我喜欢在其中编写一个小游戏。我想制作一个脚本,在游戏上方的文本上显示当前分数。为此,我喜欢使用 transform.position 脚本,但如果我使用它,它不会更新当前位置。它只显示场景开始时 GameObject 的位置。 如何将其更改为每帧显示当前场景并将其显示在屏幕上的文本字段上?
public Transform tf;
public Text textSoore;
void Start()
{
}
// Update is called once per frame
void Update()
{
tf = GetComponent<Transform>();
textSoore = GetComponent<Text>();
textSoore.text = tf.
}
}
【问题讨论】: