50

CEDEC 2013 Unity on Windows 8

Embed Size (px)

DESCRIPTION

2013/8/23 に CEDEC 2013 で講演した Unity on Windows 8 のスライドです。Windows ストア アプリ、Windows Phone 8 のビルドに対応した Unity 4.2、このセッションでは、ライブコーディングを交えて、次の内容をご紹介しました。 ・Unity のコンテンツを Windows ストア アプリにする方法 ・Unity プラグインでWindows ランタイムの機能を利用する方法 ・Unity プラグインを通じて、BaaS である Windows Azure モバイルサービスへ接続する方法 ・出来上がったアプリをWindows ストアへ申請する方法 ・Microsoft の開発者支援 セッションレポート: Unity 4.2でBaaSを使って簡単にストアアプリを作るには~CEDEC 2013「Unity on Windows 8」レポート (@IT Smart & Social) http://www.atmarkit.co.jp/ait/articles/1308/28/news022.html 関連する情報は、 http://bit.ly/UnityOnWindows8 に更新していきます。

Citation preview

Page 1: CEDEC 2013 Unity on Windows 8
Page 2: CEDEC 2013 Unity on Windows 8

デモを中心としたセッションです。

Page 3: CEDEC 2013 Unity on Windows 8

Devices

Services

Page 4: CEDEC 2013 Unity on Windows 8

Windows in

the cloud

Page 5: CEDEC 2013 Unity on Windows 8

http / https

• HTML 5 Web アプリ• デスクトップアプリ• Windowsストアアプリ

• ASP.NET MVC, ASP.NET Web API

• ASP.NET SignalR

• Windows Azure Mobile Services

REST / JSON

これからのアプリ開発の選択肢

Page 6: CEDEC 2013 Unity on Windows 8
Page 7: CEDEC 2013 Unity on Windows 8

生まれ変わった Windowsタッチが最優先

新たな開発モデル

複数のフォーム ファクター

Windows ストア

Page 8: CEDEC 2013 Unity on Windows 8
Page 9: CEDEC 2013 Unity on Windows 8

Windows 8 プラットフォーム

Page 10: CEDEC 2013 Unity on Windows 8
Page 11: CEDEC 2013 Unity on Windows 8

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

Page 12: CEDEC 2013 Unity on Windows 8
Page 13: CEDEC 2013 Unity on Windows 8

Unity

コンテンツ

作成

Windows

ストアアプリ用

にビルド

アプリの仕上げ

Windows

固有の機能の

実装

パッケージ

作成

Windows

ストアへ申請

Page 14: CEDEC 2013 Unity on Windows 8
Page 15: CEDEC 2013 Unity on Windows 8

Remote Tools for Visual Studio 2012

http://go.microsoft.com/fwlink/?LinkId=255953

Page 16: CEDEC 2013 Unity on Windows 8
Page 17: CEDEC 2013 Unity on Windows 8

Assets¥Plugins Assets¥Plugins¥Metro

Page 19: CEDEC 2013 Unity on Windows 8

Unity から Windows Azure Mobile

Services へアクセスするプラグイン

Windows 8, Windows Phone 8 対応iOS, Android 対応予定

Plugins Bitrave.Azure.dll

Newtonsoft.Json.dll (net20)

RestSharp.dll (net35-client)

Metro Bitrave.Azure.dll

RestSharp.dll

Newtonsoft.Json.dll (net45)

Page 20: CEDEC 2013 Unity on Windows 8
Page 21: CEDEC 2013 Unity on Windows 8
Page 22: CEDEC 2013 Unity on Windows 8

Unity 4.2 の制約にご注意

http://bit.ly/unity42w8

JavaScript (Unity Script) や Boo はC# コードに変更しましょう

Windows App Certification Kit

http://msdn.microsoft.com/en-us/windows/apps/jj572486.aspx

Page 23: CEDEC 2013 Unity on Windows 8

Windows ストア、開発者登録

Microsoft アカウントを作成法人の場合、共用できるアカウントを作成

Windows ストアにアクセスするコンピュータを「信頼済み PC」に登録

クレジットカードを準備 (少額決済の確認が必須)

https://appdev.microsoft.com/StorePortals/ へアクセス

法人登録の場合は、GeoTrust (Symantec) から届くメールをご確認

http://bit.ly/WSAppReg

Page 24: CEDEC 2013 Unity on Windows 8
Page 25: CEDEC 2013 Unity on Windows 8
Page 27: CEDEC 2013 Unity on Windows 8

Visual Studio with MSDN Subscription~ Visual Studio を入手するなら MSDNサブスクリプション付きで

技術サポート付き

最新バージョン、および過去バージョンを入手

Visual Studio 2013 Windows 8.1

Windows Server 2012 R2

SQL Server 2014

Team Foundation Server

Windows XP Visual Basic 6.0 MS-DOS 6.0 … など

Page 29: CEDEC 2013 Unity on Windows 8

DreamSpark とは?学生や教員のみなさまの技術的な学習や教育、研究をサポートする年間制のメンバーシッププログラムです。

www.dreamspark.com

Page 30: CEDEC 2013 Unity on Windows 8

DreamSpark のメリット

① マイクロソフトの開発ツールやサーバー製品をいつでもダウンロードできます

② 学生個人は 0円で、教育機関は 10,500円からご利用できます

③ ダウンロードした製品は永続的に利用できます

Page 31: CEDEC 2013 Unity on Windows 8
Page 32: CEDEC 2013 Unity on Windows 8
Page 33: CEDEC 2013 Unity on Windows 8

Assets¥Plugins Assets¥Plugins¥Metro

Page 34: CEDEC 2013 Unity on Windows 8
Page 35: CEDEC 2013 Unity on Windows 8

プラグインの作成

このファイルに WinRT API を使った機能を実装

WinRT 用クラスライブラリで作成したファイルのショートカットを作成1. プロジェクトを右クリック→追加→既存の項目2. UnityWinRTPluginのLiveTile.csを選択3. ダイアログの追加ボタンで

“リンクとして追加”を選択これにより、同じファイルを利用

Page 36: CEDEC 2013 Unity on Windows 8

プラグインの使い道

Windows ストアアプリ側で使用(ストアアプリプロジェクトに追加)

Build した後に実行されるコードWindows ランタイム (.NET 4.5レベル)

Unityプロジェクト側 で使用(Unity Editor 内は .NET 2.0 レベル)

条件コンパイルを利用し、Unity Editor 内で動作しないコードは含めないこと

それぞれのライブラリーを

同じアセンブリ名、同じ名前空間にすること

Page 37: CEDEC 2013 Unity on Windows 8

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;}

}}

Page 38: CEDEC 2013 Unity on Windows 8

Pluginsフォルダに

Metroという名前でサブフォルダー作成

Page 39: CEDEC 2013 Unity on Windows 8

DLLファイルをコピー

Page 40: CEDEC 2013 Unity on Windows 8

“External Script Editor”を"Browse…" からエクスプローラーを呼び出し、devenv.exe を指定して、“Visual Studio 2012”に設定

Page 41: CEDEC 2013 Unity on Windows 8

using UnityWinRTPlugin;

LiveTile tile = new LiveTile();

tile.UpdateTile(“Fire!”,DateTime.Now.ToShortTimeString());

Page 42: CEDEC 2013 Unity on Windows 8
Page 43: CEDEC 2013 Unity on Windows 8

http://msdn.microsoft.com/ja-jp/library/windows/apps/br230836.aspx

Page 44: CEDEC 2013 Unity on Windows 8
Page 45: CEDEC 2013 Unity on Windows 8
Page 46: CEDEC 2013 Unity on Windows 8
Page 47: CEDEC 2013 Unity on Windows 8
Page 48: CEDEC 2013 Unity on Windows 8
Page 49: CEDEC 2013 Unity on Windows 8

Windows アプリ認定キット (WACK)

Windows ストアにアプリを提出する前の事前テスト用ツール

パッケージの作成時に実行

あるいは、手動で呼び出し (windows app で検索)

Page 50: CEDEC 2013 Unity on Windows 8

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot

guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.