我有一个非常简单的 if 语句,它没有按预期工作。
我的主要问题是,即时窗口对 if 语句的评估与代码执行不同:
if( FreeProductStorageVolume < product.Volume * quantity )
{
Debug.Log( FreeProductStorageVolume );
Debug.Log( product.Volume );
Debug.Log( quantity );
Debug.Log( product.Volume * quantity );
canProduce = false;
}
所有变量都是浮点数
一切都表明不应命中第 824 行中的断点。
甚至即时窗口也将 if() 语句评估为假。
有没有其他人发生过这样的事情?