DavidPeicho / unity-swiftui-example

Integration example of the Unity engine in a SwiftUI-based application
MIT License
71 stars 16 forks source link

Following tutorial missing a step #4

Closed jordanjalles closed 2 years ago

jordanjalles commented 3 years ago

I followed your tutorial and always got errors from xCode not being able to find TestDelegate and other NativeCallProxy types. I spent days trying to figure this out. The missing step was to edit the UnityFramework file and add #include "NativeCallProxy.h". Either there is some a in your unity project that I don't get by default before building, or this step should be part of the procedure. Otherwise great tutorial!

DavidPeicho commented 3 years ago

Hey thanks for the heads up, are you sure you added the header as a C header bridge? You shouldn't need to manually include the header like that

DavidPeicho commented 3 years ago

I will published an updated version I worked on anyway, that setup the xcode framework directly in the Unity build system. It removes any manual step needed

jordanjalles commented 3 years ago

The missing bridge header was it! I saw that step in other tutorials but must have missed it in this one. I'm looking forward to your next version :)

DavidPeicho commented 2 years ago

No need anymore to manually bridge with the next version: https://davidpeicho.github.io/blog/unity-swiftui-integration-revisited/

I haven't finished the blog post, might have a lot of spelling mistakes and all! But basically the trick is to use a post build step in Unity.

The main branch of this repository now uses this technique!