Unity C# - 如果语句没有返回任何内容,但是调试日志呢?

时间:2017-05-04 13:56:54

标签: c# debugging unity3d timer

我的计时器四舍五入到一位小数。在我的更新功能中,我检查计时器是否为0.8,但是当它为0.8时,它不会返回任何内容。但是调试日志告诉我它已超过0.8。

https://i.gyazo.com/48e883e9b6eda385fb1afe9727b22828.png

void Update() 
{
 Debug.Log ("Elapsed time: " + (Mathf.Round(timerScript.elapsedTime * 10f) / 10f));
 if (((Mathf.Round(timerScript.elapsedTime * 10f) / 10f) == 0.8f)) {
 {
     Debug.Log ("CHECK");
 }
}

if语句太慢了吗?我该如何解决这个问题?

0 个答案:

没有答案