Created
February 23, 2022 08:31
-
-
Save eunjin3786/51aa0e230effca6748e05c007ee9ea46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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