Unity3d 错误提示 GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced
程序出現這個問題的話,程序編譯時正確,運行時報錯,而且沒有報出是哪個代碼文件出處。
這個問題一般首先去檢查Level內有用到OnGUI,Debug結果發現某代碼文件在調試代碼時複製多了一行GUILayout.BeginArea,去除這行代碼後運行正常!
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced (type:7)
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced (type:8)
出现此错误,是由于GUIClips中开始与结束的没一一对应上产生的,比如有一个 GUILayout.BeginHorizontal();而后面又没有 GUILayout.EndHorizontal();与之对应 ,就会报以上错误。