如以上步驟,再選擇 Fire 後,把 Flame 拖拉到 Hierarchy 下,就會看到 Cube 冒出火來;你也可以 Play 看看效果。
接下來,要把它建制成 Windows Store App了!
在 File –> Build Settings…中,選擇 Windows Store App –> XAML C# Solution,然後 Build And Run 後即可。
建制完畢後會在資料夾中看到完整的 Windows Store App solution:
我們以 Visual Studio 2012 開啟 .sln 檔,若直接編譯的話會看到以下錯誤:
錯誤訊息為:
Error: DEP0700: Registration of the app failed. Windows cannot install package “你的專案名” because the package requires architecture ARM, but this computer has architecture x64 (0x80073cf3).
其原因是 Unity 預設將它的 package 包成可在 ARM, x86 及 x64 不同平台執行的版本,而您的 Visual Studio 顯然並不是在 ARM 機器上跑的,所以會產生這個錯誤。
解決方法是,至 Visual Studio 的 Build –> Configuration Manager 中選擇 x86 即可。