I'm trying to make a Native iOS to Unity call on a game object.
On the native side I have:
and on Unity side I have attached this code to GameObject1 in the scene:
Allocating / Deallocating memory for UnitySendMessage()
On the native side I have:
Code (CSharp):
- char* MakeCharArray(NSString *string) {
- return strdup([string UTF8String]);
- }
- - (void)someNativeMethod {
- UnitySendMessage("GameObject1", "TestMethod", MakeCharArray([self someNSString]));
- }
Code (CSharp):
- public void TestMethod (String param) {...