Skip to content

Instantly share code, notes, and snippets.

@eunjin3786
Created February 23, 2022 08:31
Show Gist options
  • Save eunjin3786/51aa0e230effca6748e05c007ee9ea46 to your computer and use it in GitHub Desktop.
Save eunjin3786/51aa0e230effca6748e05c007ee9ea46 to your computer and use it in GitHub Desktop.
#include <UnityFramework/UnityFramework.h>
UnityFramework* UnityFrameworkLoad()
{
NSString* bundlePath = nil;
bundlePath = [[NSBundle mainBundle] bundlePath];
bundlePath = [bundlePath stringByAppendingString: @"/Frameworks/UnityFramework.framework"];
NSBundle* bundle = [NSBundle bundleWithPath: bundlePath];
if ([bundle isLoaded] == false) [bundle load];
UnityFramework* ufw = [bundle.principalClass getInstance];
if (![ufw appController])
{
// unity is not initialized
[ufw setExecuteHeader: &_mh_execute_header];
}
return ufw;
}
int main(int argc, char* argv[])
{
@autoreleasepool
{
id ufw = UnityFrameworkLoad();
[ufw runUIApplicationMainWithArgc: argc argv: argv];
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment