Skip to content

Instantly share code, notes, and snippets.

@troy-lamerton
Created June 14, 2020 14:28
Show Gist options
  • Save troy-lamerton/71409dcdbd5025946ebdf5ff5e84e0f3 to your computer and use it in GitHub Desktop.
Save troy-lamerton/71409dcdbd5025946ebdf5ff5e84e0f3 to your computer and use it in GitHub Desktop.
// unity 2019.3
#import <UIKit/UIKit.h>
#import "UnityAppController.h"
#import <Commons/Commons-Swift.h>
#import "UnityInterface.h"
@interface MainAppController : UnityAppController<UIApplicationDelegate>
@end
@implementation MainAppController
- (void)preStartUnity {
[super preStartUnity];
// must set this first, lots of other swift code depends on UnitySendMessage
[UnityInterfaceSw setUnitySendMessage: (^(const char * _Nonnull g, const char * _Nonnull m, const char * _Nonnull a) {
UnitySendMessage(g, m, a);
})];
}
@end
IMPL_APP_CONTROLLER_SUBCLASS(MainAppController)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment