Thursday, December 10, 2015

Executing native iOS code from Unity C# (and vice versa)

Real quick post today, but all the solutions I found for this were surprisingly verbose. Here's how:

Calling iOS Methods From Unity

1. In your C# class: 2. In your UnityAppController.mm: Calling Unity C# Methods from Xcode

1. In your UnityAppController.mm: Keep in mind that this only works on actual devices (not in the Editor) and is processor intensive so keep usage to a minimum.

Boom! That's it.