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.3k
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
390
Better use of SwiftUI
tattn
0
340
Swift Concurrencyによる安全で快適な非同期処理
tattn
2
980
iOSアプリの技術選択2022
tattn
7
3.6k
Widget Suggestions 対応と ヤフーの新OS対応
tattn
1
1.1k
WidgetKitで良い体験を作るには / Good experience with WidgetKit
tattn
2
1.3k
既存アプリにSwiftUIをどう組み込んでいくか
tattn
8
2k
iOS 14からのアプリ内課金
tattn
5
2.4k
iOS 14の位置情報系アップデート
tattn
0
21k
Other Decks in Programming
See All in Programming
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
Hanami and htmx
bkuhlmann
0
210
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
280
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
200
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
670
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
ONE WEDGE_company_guide
1wedge_one
0
460
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.1k
PHPはいつから死んでいるかの調査
chiroruxx
1
390
Anthropic Cookbook のおすすめレシピ
schroneko
7
870
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
How to name files
jennybc
65
93k
Gamification - CAS2011
davidbonilla
76
4.6k
Done Done
chrislema
178
15k
Automating Front-end Workflow
addyosmani
1356
200k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
The Language of Interfaces
destraynor
151
23k
What's in a price? How to price your products and services
michaelherold
237
11k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Practical Orchestrator
shlominoach
182
9.7k
Typedesign – Prime Four
hannesfritz
36
2.1k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
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