大家好,我是孫廣東。 轉(zhuǎn)載請注明出處:http://blog.csdn.net/u010019717
更全的內(nèi)容請看我的游戲蠻牛地址:http://www.unitymanual.com/space-uid⑴8602.html
問題:
如果您使用Git可見元visible meta文件,你不能完全刪除Assets 資產(chǎn)文件夾下的文件夾。對他們刪除或重命名的文件夾仿佛在你以后已刪除。但隨著時間的推移,你會再見到文件夾。
Why?
該場景是這樣的:
You delete(or rename) some folders in Unity Editor.
Your Unity Editor deletes corresponding meta files too.
You commit and push the changes.
One of your colleagues pulls your changes.
The Git client deletes all files in that (deleted) folders, but it doesn’t delete the folders. (*)
Her(or his) Unity Editor detects the empty folders and creates meta files for them. (**)
She commits and pushes the meta files with her other changes.
You pull her changes.
And you see the folders again!
* Git不跟蹤文件夾。 它只跟蹤文件。所以即便你刪除1個文件夾,對Git,這意味著你已刪除該文件夾中的所有文件。
* * 我有測試 Unity 3D 4.3 and 4.6 beta.
解決方案Solution:
1種選擇是使用 ‘git clean -df’ 命令。 它將刪除所有跟蹤文件包括目錄。但是,您的團隊的所有成員應(yīng)運行此命令,他們pulled 你的改變。否則,Unity 3D將為空文件夾生成meta元文件。
另外一個選項是使用Clean Empty Directories資產(chǎn)。它是免費的。 它有ui來查找和刪除空目錄與您的項目中的他們的meta元文件。還有1件事。 它有1個選項,它查找并刪除空目錄,每當您保存場景。如果您的團隊的所有成員啟用此選項,將不會有機會你再遇到刪除的文件夾。
概要:
你遭受過Unity3D和Git上的空目錄問題嗎?那末此asset可能幫助你。 你可以在項目中查找并刪除空目錄。每當您保存場景時,你可以打開1個選項,它查找并刪除空目錄。
如何使用?:
單擊Find Empty Dirs 按鈕來查找項目中的所有空目錄。在審查目錄以后,請單擊Delete All 按鈕將目錄移動到垃圾桶。
Automatic Clean Option
If you check Clean Empty Dirs Automatically On Save option, it finds anddeletes empty directories whenever you save a scene.