Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Embedded Unity
Search
Tatsuya Tanaka
October 09, 2018
Programming
4
1.4k
Embedded Unity
#potatotips 55
Tatsuya Tanaka
October 09, 2018
Tweet
Share
More Decks by Tatsuya Tanaka
See All by Tatsuya Tanaka
iPhoneのセンサー情報をmacOSアプリでリアルタイム活用するための技術
tattn
1
510
Better use of SwiftUI
tattn
0
380
Swift Concurrencyによる安全で快適な非同期処理
tattn
2
1.1k
iOSアプリの技術選択2022
tattn
7
3.7k
Widget Suggestions 対応と ヤフーの新OS対応
tattn
1
1.2k
WidgetKitで良い体験を作るには / Good experience with WidgetKit
tattn
2
1.5k
既存アプリにSwiftUIをどう組み込んでいくか
tattn
8
2.3k
iOS 14からのアプリ内課金
tattn
5
2.7k
iOS 14の位置情報系アップデート
tattn
0
22k
Other Decks in Programming
See All in Programming
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
CSC509 Lecture 13
javiergs
PRO
0
110
Remix on Hono on Cloudflare Workers
yusukebe
1
300
CSC509 Lecture 09
javiergs
PRO
0
140
Click-free releases & the making of a CLI app
oheyadam
2
120
Quine, Polyglot, 良いコード
qnighy
4
650
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
960
初めてDefinitelyTypedにPRを出した話
syumai
0
420
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
32
1.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Thoughts on Productivity
jonyablonski
67
4.3k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Music & Morning Musume
bryan
46
6.2k
Done Done
chrislema
181
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Transcript
Embedded Unity ాதୡ (@tattn) #potatotips 55
ాத ୡ (@tattn) • Yahoo!Ҋ • iOSΞϓϦΤϯδχΞ @tattn @tanakasan2525 @tattn
(झຯͰUnityͬͯ·͢)
Unityͱ
Unityͱ ԿͰἧͬͯΔήʔϜΤϯδϯ 2D/3DͷάϥϑΟοΫεΛ؆୯ʹѻ͑Δɻ Mac/Win/Linux/iOS/Android/Web/PS4/Switch... ͳͲ͍͍ͩͨͷڥͰಈ͘ɻ
UnityΞϓϦͷಛ • ωΠςΟϒͷUIͰͳ͘ɺ ಠࣗͷUIͰ࣮͢Δ • ϑϧεΫϦʔϯ
Unityͷ࠾༻͕ਏ͍ྫ ωΠςΟϒͷUIͰͳ͘ɺಠࣗͷUIͰ࣮͢Δ ͋Δը໘ΛUnityͰඳը͍͕ͨ͠ɺ ͦΕҎ֎ωΠςΟϒͷUI͕ྑ͍߹େม (͍ۙUIΛࣗલͰ࣮͢Δඞཁ͕͋Δ)
Embedded Unity
UnityΛωΠςΟϒΞϓϦʹຒΊࠐΉ
DEMO
DEMOࣦഊ༻ / PDF༻ ←ωΠςΟϒͷ NavigationBar ωΠςΟϒͷ ˡTabBar ←ωΠςΟϒͷ Switch ←Unityͷը໘͕
ϑϧεΫϦʔϯ Ͱͳ͍
UnityͷωΠςΟϒϏϧυͷ ͘͠Έ
UnityͷiOSϏϧυ 1. C#ͷίʔυΛC#ίϯύΠϥͰϚωʔδυΞηϯϒϦԽ 2. ࠷దԽ (͍ͬͯͳ͍ඪ४ΫϥεͷίʔυআͳͲ) 3. IL2CPPͰC++ͷίʔυʹม 4. ClangͰiOS༻ͷόΠφϦϏϧυ
IUUQTEPDTVOJUZEDPN%PDVNFOUBUJPO.BOVBM*-$11)PX*U8PSLTIUNM
Unityͷը໘ (iOS) ࣗಈੜ͞ΕͨAppDelegateͰ ViewControllerViewΛΈཱͯͯ ϑϧεΫϦʔϯͷը໘Λද͍ࣔͯ͠Δ
UnityͷViewΛҾͬுͬͯ͘Ε ͖ͳͱ͜ΖʹUnityͷը໘Λஔ͚Δ
UnityΛEmbedded FrameworkԽ͢Δ ※Unity 2018.2.11f1ɺXcode 10.0Λ༻
Cocoa Touch FrameworkΛͭ͘Δ ੜ͞ΕͨϓϩδΣΫτΛ։͖ɺ frameworkΛλʔήοτʹՃɻ Unity-iPhoneʹ͋Δ.mm.hϑΝΠϧΛ ΄΅ίϐʔ͢Δ
༻͢ΔHeaderΛPublicʹ͢Δ framework֎͔Β༻͢ΔHeaderΛPublicʹ͢Δ
ϓϩδΣΫτઃఆΛॻ͖͑Δ .xcconfigϑΝΠϧΛ࡞ͬͯɺઃఆ͢Δͱָ (Ұ෦ൈਮ) IUUQTHJTUHJUIVCDPNUBUUOEBDDCDEGGFD
ίʔυΛগ͠ॻ͖͑Δ ύεΛมߋͨ͠Γɺextern "C"ͳͲΛՃ͢Δ ͕࣌ؒͳ͍ͷͰলུ
ωΠςΟϒΞϓϦʹΈࠐΉ ࣗಈੜ͞Εͨmain.mmΛࢀߟʹ͢Δ
UnityͷViewΛऔಘͯ͠දࣔ
iOSͱUnityؒͷΓऔΓ (ωΠςΟϒ) UnitySendMessageͰ UnityʹσʔλΛૹΔ (Unity) ಉ໊ͷϝιουͰ σʔλΛड͚औΔ (σϞ༻ͷ࣮ͷͨΊϩδοΫదͰ͢...)
͢Δͱɺ͜͏ͳΓ·͢
Unityͷগ͠લͷϦϦʔεϊʔτ IUUQTVOJUZEDPNKQVOJUZXIBUTOFXVOJUZ (1068657) - IL2CPP: Prevented a crash in il2cpp::os::Image::Initialize
when Unity is embedded in another app on iOS. →iOSͰଞͷΞϓϦʹUnityΛຒΊࠐΜͩ࣌ͷΫϥογϡΛ͙ UnityଆEmbeddedΛαϙʔτ͢Δҙࢥ͕͋Δ
·ͱΊ
ωΠςΟϒΞϓϦʹUnityΛΈࠐΊΔ • গ͠मਖ਼͍Δ͕Framework / AARԽͰ͖Δ • UnityͷPostProcessBuildΛ͏ͱमਖ਼࡞ۀΛ શʹࣗಈԽͰ͖Δ • Unityͷ๛ͳࢿ࢈Λ͑Δ
ʘSceneKitɾOpenGL͕ਏ͍߹͋Γ͔ʗ
ࢀߟจݙ • https://github.com/jiulongw/swift-unity • https://github.com/blitzagency/ios-unity5 • https://github.com/samizzo/UnityNativePrototype • https://forum.unity.com/threads/build-unity-app-as-framework-then-consumed- by-another-app.430068/
• https://issuetracker.unity3d.com/issues/il2cpp-ios-crash-in-il2cpp-os-image- initialize-inlined-il2cpp-os-image-initializemanagedsection-at-image-dot-cpp-81