unity on windows 8.1
DESCRIPTION
Unity 4.3 と Windows 8.1を利用して、Windows ストアアプリを開発する流れをご紹介します。TRANSCRIPT
Unity on Windows 8.1
http://aka.ms/Unity4win
2
Windows 81 億以上のライセンス
ストアに 10 万アプリ以上2.5 億以上のダウンロード
200 ヶ国以上で提供
Windows 8.1Windows 8 と RT向けに無償提供
2013 年 10 月 18日リリースより多くのデバイス サポート
5
Windows 8.1 プラットフォーム
6
7
Orcs Must Survive
Drift Mania Championship 2
Pettson's Inventions
Gunpowder
Rumpelstiltskin 3D
Snow White Prequel
Razor Salvation
Siegecraft
Qbism
Hungry MonstR
Fling Theory
Experiment HD など
Big Buck Hunter
8
9
10
Unity
コンテンツ
作成
Windows
ストアアプリ用
にビルド
アプリの仕上げ
Windows
固有の機能の
実装
パッケージ
作成
Windows
ストアへ申請
11
12
Remote Tools for Visual Studio 2013 (ARM)http://go.microsoft.com/?linkid=9832099
13
14
• HTML タグ、コントロールによる簡単な配置• pubCenter による海外の税金処理など• インプレッション課金http://adsinapps.microsoft.com/ja/sdk
15
Assets¥Plugins Assets¥Plugins¥Metro
16
開発者登録
マイクロソフト アカウントを使用
年間登録費用
個人 : 1,847 円
法人 : 9,800 円
クレジットカードでの支払い
https://appdev.microsoft.com/storePortals/
17
19
http://bit.ly/UnityOnWindows8
http://www.bitrave.com/azure-mobile-services-for-unity-3d/
http://scan.xamarin.com/
http://aka.ms/8store
http://msdn.microsoft.com/ja-jp/hh455217.aspx
http://www.microsoft.com/ja-jp/mic/bizspark/default.aspx
22
http://bit.ly/WAMobileService
23
Unity から Windows Azure Mobile Services へアクセスするプラグイン
Windows 8, Windows Phone 8 対応iOS, Android 対応予定
Plugins Bitrave.Azure.dllNewtonsoft.Json.dll (net20)RestSharp.dll (net35-client)
Metro Bitrave.Azure.dllRestSharp.dllNewtonsoft.Json.dll (net45)
24
25
/*CriAtomSouceを取得*/
CriAtomSource atom_src = selectedGameObject.GetComponent<CriAtomSource>();/* 再生開始*/
atom_src.Play();
26
アプリ パッケージの作成
Windows ストア アプリの展開
アプリ パッケージの登録
Windows ストアでの公開
27
28
Windows App Certification Kithttp://msdn.microsoft.com/en-us/windows/apps/bg127575
Assets¥Plugins Assets¥Plugins¥Metro
プラグインの作成
このファイルに WinRT API を使った機能を実装
WinRT 用クラスライブラリで作成したファイルのショートカットを作成1. プロジェクトを右クリック→追加→既存の項目2. UnityWinRTPluginのLiveTile.csを選択3. ダイアログの追加ボタンで
“リンクとして追加”を選択これにより、同じファイルを利用
プラグインの使い道
Windows ストアアプリ側で使用(ストアアプリプロジェクトに追加)
Build した後に実行されるコードWindows ランタイム (.NET 4.5レベル)
Unityプロジェクト側 で使用(Unity Editor 内は .NET 3.5 レベル)
条件コンパイルを利用し、Unity Editor 内で動作しないコードは含めないこと
それぞれのライブラリーを
同じアセンブリ名、同じ名前空間にすること
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;#if NETFX_COREusing Windows.UI.Notifications;#endif
namespace UnityWinRTPlugin{
public class LiveTile{
public bool UpdateTile(string title, string text){
#if NETFX_COREvar tile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquareText02);var elements = tile.GetElementsByTagName("text");elements[0].AppendChild(tile.CreateTextNode(title));elements[1].AppendChild(tile.CreateTextNode(text));
TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(tile));#endif
return true;}
}}
Pluginsフォルダに
Metroという名前でサブフォルダー作成
DLLファイルをコピー
“External Script Editor”を"Browse…" からエクスプローラーを呼び出し、devenv.exe を指定して、“Visual Studio 2012”に設定
using UnityWinRTPlugin;
LiveTile tile = new LiveTile();
tile.UpdateTile(“Fire!”,DateTime.Now.ToShortTimeString());