【发布时间】:2017-10-16 11:16:33
【问题描述】:
“分数:”未在统一 ide 上显示。我尝试了很多,但似乎没有任何效果,也没有按预期获得输出。谢谢。抱歉英语不好。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class uiManager : MonoBehaviour {
public Text scoreText;
int score;
// Use this for initialization
void Start () {
score = 0;
}
void score_view()
{
score = move.score;
Debug.Log("uiManager Score:"+score);
scoreText.text = "Score:"+score;
}
// Update is called once per frame
void Update ()
{
score_view();
}
}
【问题讨论】:
-
Update仅在游戏运行时运行。如果您不运行游戏,您将看不到这一点