Embedded Unity

Embedded Unity

#potatotips 55

0620564f0125b8b3b7f4fe40c10b8b4e?s=128

Tatsuya Tanaka

October 09, 2018
Tweet

Transcript

  1. Embedded Unity ాதୡ໵ (@tattn) #potatotips 55

  2. ాத ୡ໵ (@tattn) • Yahoo!৐׵Ҋ಺ • iOSΞϓϦΤϯδχΞ @tattn @tanakasan2525 @tattn

    (झຯͰUnity΍ͬͯ·͢)
  3. Unityͱ͸

  4. Unityͱ͸ ԿͰ΋ἧͬͯΔήʔϜΤϯδϯ
 2D/3DͷάϥϑΟοΫεΛ؆୯ʹѻ͑Δɻ
 Mac/Win/Linux/iOS/Android/Web/PS4/Switch...
 ͳͲ͍͍ͩͨͷ؀ڥͰಈ͘ɻ

  5. Unity੡ΞϓϦͷಛ௃ • ωΠςΟϒͷUIͰ͸ͳ͘ɺ
 ಠࣗͷUIͰ࣮૷͢Δ • ϑϧεΫϦʔϯ

  6. Unityͷ࠾༻͕ਏ͍ྫ ωΠςΟϒͷUIͰ͸ͳ͘ɺಠࣗͷUIͰ࣮૷͢Δ ͋Δը໘ΛUnityͰඳը͍͕ͨ͠ɺ
 ͦΕҎ֎͸ωΠςΟϒͷUI͕ྑ͍৔߹͸େม
 (͍ۙUIΛࣗલͰ࣮૷͢Δඞཁ͕͋Δ)

  7. Embedded Unity

  8. UnityΛωΠςΟϒΞϓϦʹຒΊࠐΉ

  9. DEMO

  10. DEMOࣦഊ༻ / PDF༻ ←ωΠςΟϒͷ
 NavigationBar ωΠςΟϒͷ
 ˡTabBar ←ωΠςΟϒͷ
 Switch ←Unityͷը໘͕


    ϑϧεΫϦʔϯ
 Ͱ͸ͳ͍
  11. UnityͷωΠςΟϒϏϧυͷ ͘͠Έ

  12. UnityͷiOSϏϧυ 1. C#ͷίʔυΛC#ίϯύΠϥͰϚωʔδυΞηϯϒϦԽ 2. ࠷దԽ (࢖͍ͬͯͳ͍ඪ४Ϋϥεͷίʔυ࡟আͳͲ) 3. IL2CPPͰC++ͷίʔυʹม׵ 4. ClangͰiOS༻ͷόΠφϦ΁Ϗϧυ

    IUUQTEPDTVOJUZEDPN%PDVNFOUBUJPO.BOVBM*-$11)PX*U8PSLTIUNM
  13. Unityͷը໘ (iOS) ࣗಈੜ੒͞ΕͨAppDelegateͰ
 ViewController΍ViewΛ૊Έཱͯͯ
 ϑϧεΫϦʔϯͷը໘Λද͍ࣔͯ͠Δ

  14. UnityͷViewΛҾͬுͬͯ͘Ε͹
 ޷͖ͳͱ͜ΖʹUnityͷը໘Λஔ͚Δ

  15. UnityΛEmbedded FrameworkԽ͢Δ ※Unity 2018.2.11f1ɺXcode 10.0Λ࢖༻

  16. Cocoa Touch FrameworkΛͭ͘Δ ੜ੒͞ΕͨϓϩδΣΫτΛ։͖ɺ
 frameworkΛλʔήοτʹ௥Ճɻ Unity-iPhoneʹ͋Δ.mm΍.hϑΝΠϧΛ
 ΄΅ίϐʔ͢Δ

  17. ࢖༻͢ΔHeaderΛPublicʹ͢Δ framework֎͔Β࢖༻͢ΔHeaderΛPublicʹ͢Δ

  18. ϓϩδΣΫτઃఆΛॻ͖׵͑Δ .xcconfigϑΝΠϧΛ࡞ͬͯɺઃఆ͢Δͱָ (Ұ෦ൈਮ) IUUQTHJTUHJUIVCDPNUBUUOEBDDCDEGGFD

  19. ίʔυΛগ͠ॻ͖׵͑Δ ύεΛมߋͨ͠Γɺextern "C"ͳͲΛ௥Ճ͢Δ ͕࣌ؒͳ͍ͷͰলུ

  20. ωΠςΟϒΞϓϦʹ૊ΈࠐΉ ࣗಈੜ੒͞Εͨmain.mmΛࢀߟʹ͢Δ

  21. UnityͷViewΛऔಘͯ͠දࣔ

  22. iOSͱUnityؒͷ΍ΓऔΓ (ωΠςΟϒ)
 UnitySendMessageͰ
 UnityʹσʔλΛૹΔ (Unity)
 ಉ໊ͷϝιουͰ
 σʔλΛड͚औΔ (σϞ༻ͷ࣮૷ͷͨΊϩδοΫ͸ద౰Ͱ͢...)

  23. ͢Δͱɺ͜͏ͳΓ·͢

  24. 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Λαϙʔτ͢Δҙࢥ͕͋Δ
  25. ·ͱΊ

  26. ωΠςΟϒΞϓϦʹUnityΛ૊ΈࠐΊΔ • গ͠मਖ਼͸͍Δ͕Framework / AARԽͰ͖Δ • UnityͷPostProcessBuildΛ࢖͏ͱमਖ਼࡞ۀΛ
 ׬શʹࣗಈԽͰ͖Δ • Unityͷ๛෋ͳࢿ࢈Λ࢖͑Δ

    ʘSceneKitɾOpenGL͕ਏ͍৔߹͸͋Γ͔΋ʗ
  27. ࢀߟจݙ • 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