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.5k
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
570
Better use of SwiftUI
tattn
0
420
Swift Concurrencyによる安全で快適な非同期処理
tattn
2
1.2k
iOSアプリの技術選択2022
tattn
7
3.8k
Widget Suggestions 対応と ヤフーの新OS対応
tattn
1
1.3k
WidgetKitで良い体験を作るには / Good experience with WidgetKit
tattn
2
1.6k
既存アプリにSwiftUIをどう組み込んでいくか
tattn
8
2.3k
iOS 14からのアプリ内課金
tattn
5
2.8k
iOS 14の位置情報系アップデート
tattn
0
22k
Other Decks in Programming
See All in Programming
Devin入門と最近のアップデートから見るDevinの進化 / Introduction to Devin and the Evolution of Devin as Seen in Recent Update
rkaga
9
4.8k
技術選定を未来に繋いで活用していく
sakito
3
110
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
0
200
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
SQL Server ベクトル検索
odashinsuke
0
170
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
210
Django for Data Science (Boston Python Meetup, March 2025)
wsvincent
0
330
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
0
670
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
720
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
490
KawaiiLT 登壇資料 キャリアとモチベーション
hiiragi
0
100
Being an ethical software engineer
xgouchet
PRO
0
210
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Side Projects
sachag
452
42k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Optimising Largest Contentful Paint
csswizardry
36
3.2k
Visualization
eitanlees
146
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
13
1.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
The Pragmatic Product Professional
lauravandoore
33
6.5k
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