升级到 XCFramework,添加模拟器支持
- 创建支持真机和模拟器的 XCFramework - 模拟器版本使用空壳实现,用于开发调试 - 真机版本包含完整 Unity 运行时 - 更新 podspec 版本到 1.0.7 - 移除所有架构排除配置,XCFramework 自动处理
This commit is contained in:
94
simulator_stub/UnityFrameworkStub.m
Normal file
94
simulator_stub/UnityFrameworkStub.m
Normal file
@@ -0,0 +1,94 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// Stub implementation for simulator
|
||||
typedef struct mach_header_64 MachHeader;
|
||||
|
||||
@protocol UnityFrameworkListener<NSObject>
|
||||
@optional
|
||||
- (void)unityDidUnload:(NSNotification*)notification;
|
||||
- (void)unityDidQuit:(NSNotification*)notification;
|
||||
@end
|
||||
|
||||
@interface UnityAppController : NSObject
|
||||
@end
|
||||
|
||||
@implementation UnityAppController
|
||||
@end
|
||||
|
||||
@interface UnityFramework : NSObject
|
||||
@end
|
||||
|
||||
@implementation UnityFramework
|
||||
|
||||
+ (instancetype)getInstance {
|
||||
static UnityFramework *instance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[self alloc] init];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (id)appController {
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (UITextField*)keyboardTextField {
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setDataBundleId:(const char*)bundleId {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)runUIApplicationMainWithArgc:(int)argc argv:(char*[])argv {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)runEmbeddedWithArgc:(int)argc argv:(char*[])argv appLaunchOpts:(NSDictionary*)appLaunchOpts {
|
||||
// Stub - 模拟器不运行 Unity
|
||||
NSLog(@"UnityFramework: Simulator stub - Unity not available");
|
||||
}
|
||||
|
||||
- (void)unloadApplication {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)quitApplication:(int)exitCode {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)registerFrameworkListener:(id)obj {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)unregisterFrameworkListener:(id)obj {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)showUnityWindow {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)pause:(bool)pause {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)setAbsoluteURL:(const char *)url {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)setExecuteHeader:(const MachHeader*)header {
|
||||
// Stub
|
||||
}
|
||||
|
||||
- (void)sendMessageToGOWithName:(const char*)goName functionName:(const char*)name message:(const char*)msg {
|
||||
// Stub
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
// Export version symbols
|
||||
double UnityFrameworkVersionNumber = 1.0;
|
||||
const unsigned char UnityFrameworkVersionString[] = "1.0";
|
||||
Reference in New Issue
Block a user