- void UnityInitTrampoline() {#
- if ENABLE_CRASH_REPORT_SUBMISSION SubmitCrashReportsAsync();#endif InitCrashHandling();
- _ios42orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"4.2"options: NSNumericSearch] != NSOrderedAscending;
- _ios43orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"4.3"options: NSNumericSearch] != NSOrderedAscending;
- _ios50orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"5.0"options: NSNumericSearch] != NSOrderedAscending;
- _ios60orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"6.0"options: NSNumericSearch] != NSOrderedAscending;
- _ios70orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"7.0"options: NSNumericSearch] != NSOrderedAscending;
- _ios80orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"8.0"options: NSNumericSearch] != NSOrderedAscending;
- _ios81orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"8.1"options: NSNumericSearch] != NSOrderedAscending;
- _ios82orNewer = [[[UIDevice currentDevice] systemVersion] compare: @"8.2"options: NSNumericSearch] != NSOrderedAscending;
- // Try writing to console and if it fails switch to NSLog logging
- fprintf(stdout, "\n");
- if (ftell(stdout) < 0) SetLogEntryHandler(LogToNSLogHandler);
- // Fix home directory environment variable.
- const char * newHomeDirectory = ([[NSHomeDirectory() stringByAppendingPathComponent: @"Documents"] UTF8String]);
- setenv("XDG_CONFIG_HOME", newHomeDirectory, 1);
- UnityInitJoysticks();
- }
来源: http://lib.csdn.net/snippet/ios/43459