Unity3d 4.xx以上版本容易出现的bug:
如下:
解决方案1:
it seems to be related to calling SetActive(bool) on the GameObject containing the GUI code. However - the result is different depending on the context.
- Disable GUI object in Start() of another object: error happens immediately
- Same but yield a frame in Start(): same result
- Disable GUI object in Update() of another object: error happens immediately
- Disable GUI object via Inspector: error happens immediately
- Disable GUI object via non-MonoBehaviour code later in game's lifecycle: works until you strike a key on the keyboard then error occurs
解决方案2:
保存场景,然后重启。问题解决!
温馨提示:
通过上面的方法还没有解决Bug,那就不用管它了。它对我们的程序是没有什么影响的!
结束语:
enjoy!