cleanup
This commit is contained in:
parent
ea71d3b2be
commit
72295561c7
|
@ -6,12 +6,11 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Flutter/Flutter.h>
|
#import <Flutter/Flutter.h>
|
||||||
#import <UnityUtils.h>
|
|
||||||
|
|
||||||
@interface FlutterUnityWidgetPlugin : NSObject<FlutterPlugin>
|
@interface FlutterUnityWidgetPlugin : NSObject<FlutterPlugin>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface FUController : NSObject <FlutterPlatformView, UnityEventListener>
|
@interface FUController : NSObject <FlutterPlatformView>
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
viewIdentifier:(int64_t)viewId
|
viewIdentifier:(int64_t)viewId
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
registrar:(NSObject<FlutterPluginRegistrar> *)registrar;
|
registrar:(NSObject<FlutterPluginRegistrar> *)registrar;
|
||||||
|
|
||||||
- (UIView*)view;
|
- (UIView*)view;
|
||||||
- (void)onMessage:(NSString *)message;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface FUViewFactory : NSObject <FlutterPlatformViewFactory>
|
@interface FUViewFactory : NSObject <FlutterPlatformViewFactory>
|
||||||
|
|
|
@ -67,10 +67,6 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)onMessage:(NSString *)message {
|
|
||||||
[_channel invokeMethod:@"onUnityMessage" arguments:message];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)onMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
|
- (void)onMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
|
||||||
if ([[call method] isEqualToString:@"postMessage"]) {
|
if ([[call method] isEqualToString:@"postMessage"]) {
|
||||||
[self postMessage:call result:result];
|
[self postMessage:call result:result];
|
||||||
|
|
|
@ -23,11 +23,6 @@ extern "C" {
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@protocol UnityEventListener <NSObject>
|
|
||||||
- (void)onMessage:(NSString *)message;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface UnityUtils : NSObject
|
@interface UnityUtils : NSObject
|
||||||
|
|
||||||
+ (BOOL)isUnityReady;
|
+ (BOOL)isUnityReady;
|
||||||
|
|
|
@ -153,7 +153,7 @@ static BOOL _isUnityReady = NO;
|
||||||
UnityAppController *controller = GetAppController();
|
UnityAppController *controller = GetAppController();
|
||||||
[controller application:application didFinishLaunchingWithOptions:nil];
|
[controller application:application didFinishLaunchingWithOptions:nil];
|
||||||
[controller applicationDidBecomeActive:application];
|
[controller applicationDidBecomeActive:application];
|
||||||
|
|
||||||
[UnityUtils listenAppState];
|
[UnityUtils listenAppState];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue