1:mp3沒有聲音
如圖:導入到場景中的mp3格式的音樂在預覽界面點擊播放,聽不到聲音。但是用外部播放器打開對應文件夾下的該文件卻有聲音的。
把文件刪除、重新導入,依舊沒有聲音。
最后重啟Unity3D,尼瑪,可以了。。。這個BUG,3年前就存在了。。
2:圖片導入后Could not create texture from XXXX;File could not be read.
無論是直接復制粘貼到unity3d文件夾內還是用import都報錯如下。圖片是白色的,不顯示內容。

解決方法:用photoshop打開,重新保存一道??赡苁蔷幋a的問題吧~~~
2:Build Problem - asset is marked as don’t save
20140512(汶川六年)
今天做電影學院3D互動項目,切換為成android平臺后,build and run的時候報了一些列錯。如下圖:
Error 1:
An asset is marked as dont save, but is included in the build:
UnityEditor.HostView:OnGUI()
Error 2:
Building - Failed to write file: sharedassets0.assets UnityEditor.HostView:OnGUI()
Error 3:
Error building Player: Couldn’t build player because of unsupported data on target platform.
這是論壇上對該問題的討論:http://answers.unity3d.com/answers/706282/view.html
我關閉unity后,重新打開。問題消失
3:Profiler LogStringToConsole
Necromancy項目,主角死亡后,復活后幀率極度下降,打開profiler

發(fā)現(xiàn)FriendAnimationControl.cs腳本中的debug占用了幾乎全部的內存消耗。
問題是FriendAnimationControl.cs上的腳本已經完全注釋了Debug.Log以及Printf了。


如上圖,在Console面板點擊Open Editor Log
在詳細的Editor Log中發(fā)現(xiàn)了很多句如下信息:
!(Log信息)[/img/LogClear.png]
這些信息,被當作垃圾debug信息,沒有顯示在Console的面板中,只能通過Log日志看到。
于是追本溯源,在FriendAnimationControl.cs腳本中發(fā)現(xiàn)在主角死亡的時候設置了animator.runtimeAnimatorController = null;
導致主角復活后,友軍繼續(xù)執(zhí)行animator.SetBool之類的操作,報錯Animator has not been initialized??上У氖窃搱箦e被當作垃圾信息了……
4: Shader wants normals, but the mesh XXX doesn’t have them的警告

找到名為XXX的mesh,發(fā)現(xiàn)其用的shader 是diffuse,根本不需要法線貼圖。
再仔細看看,這個XXX mesh是用代碼生成的。于是最后調用了RecalculateNormals()方法,順利解決。(_trailMesh.RecalculateNormals());
5:Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption
出現(xiàn)情況描述:Resource.Load了一個Prefab,并as強制轉換為GameObject類型bb。然后設置bb的父物體為場景中已知的物體。報錯如上。
解決方法:還必須Instantiate一下bb,并存到cc中,然后就可以隨便操縱cc了,不會發(fā)生上述報錯:
GameObject bb=Resources.Load(XXX) as GameObject;
GameObject cc=Instantiate(bb);
轉自:http://bbbbbbion.github.io/2015/10/03/Unity3D%20bug%E7%A7%AF%E7%B4%AF/