no message
This commit is contained in:
parent
e5f1398bc3
commit
d7699c93cd
@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import cocos_view_pod
|
||||
|
||||
|
||||
private var cocos_warmed_up = false
|
||||
@ -37,16 +38,9 @@ public func InitCocosIntegrationWithOptions(
|
||||
|
||||
// Load cocos framework for fisrt run
|
||||
func CocosFrameworkLoad() -> CocosFramework? {
|
||||
var bundlePath: String? = nil
|
||||
bundlePath = Bundle.main.bundlePath
|
||||
bundlePath = (bundlePath ?? "") + "/Frameworks/CocosFramework.framework"
|
||||
|
||||
|
||||
let bundle = Bundle(path: bundlePath ?? "")
|
||||
if bundle?.isLoaded == false {
|
||||
bundle?.load()
|
||||
}
|
||||
|
||||
return bundle?.principalClass?.getInstance()
|
||||
return dcocos_bridge.instance()
|
||||
}
|
||||
|
||||
/*********************************** GLOBAL FUNCS & VARS START**************************************/
|
||||
@ -87,10 +81,10 @@ var sharedApplication: UIApplication?
|
||||
|
||||
self.ufw = CocosFrameworkLoad()
|
||||
|
||||
self.ufw?.setDataBundleId("com.cocos3d.framework")
|
||||
//self.ufw?.setDataBundleId("com.cocos3d.framework")
|
||||
|
||||
registerCocosListener()
|
||||
self.ufw?.runEmbedded(withArgc: gArgc, argv: gArgv, appLaunchOpts: appLaunchOpts)
|
||||
// self.ufw?.runEmbedded(withArgc: gArgc, argv: gArgv, appLaunchOpts: appLaunchOpts)
|
||||
|
||||
if self.ufw?.appController() != nil {
|
||||
controller = self.ufw?.appController()
|
||||
@ -147,13 +141,13 @@ var sharedApplication: UIApplication?
|
||||
|
||||
func registerCocosListener() {
|
||||
if self.cocosIsInitiallized() {
|
||||
self.ufw?.register(self)
|
||||
// self.ufw?.register(self)
|
||||
}
|
||||
}
|
||||
|
||||
func unregisterCocosListener() {
|
||||
if self.cocosIsInitiallized() {
|
||||
self.ufw?.unregisterFrameworkListener(self)
|
||||
// self.ufw?.unregisterFrameworkListener(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CocosFramework
|
||||
|
||||
|
||||
// Defines cocos controllable from Flutter.
|
||||
public class FLTCocosWidgetController: NSObject, FLTCocosOptionsSink, FlutterPlatformView {
|
||||
@ -30,7 +30,7 @@ public class FLTCocosWidgetController: NSObject, FLTCocosOptionsSink, FlutterPla
|
||||
|
||||
self.viewId = viewId
|
||||
|
||||
let channelName = String(format: "plugin.xraph.com/cocos_view_%lld", viewId)
|
||||
let channelName = String(format: "plugin.gem.com/cocos_view_%lld", viewId)
|
||||
self.channel = FlutterMethodChannel(name: channelName, binaryMessenger: registrar.messenger())
|
||||
|
||||
self.channel?.setMethodCallHandler(self.methodHandler)
|
||||
|
@ -1,18 +1,18 @@
|
||||
#import FlutterCocosWidgetPlugin.h
|
||||
#import <Foundation/Foundation.h>
|
||||
#if __has_include(<flutter_unity_widget/flutter_unity_widget-Swift.h>)
|
||||
#import <flutter_unity_widget/flutter_unity_widget-Swift.h>
|
||||
#if __has_include(<flutter_cocos_widget/flutter_cocos_widget-Swift.h>)
|
||||
#import <flutter_cocos_widget/flutter_cocos_widget-Swift.h>
|
||||
#else
|
||||
// Support project import fallback if the generated compatibility header
|
||||
// is not copied when this plugin is created as a library.
|
||||
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
|
||||
#import "flutter_unity_widget-Swift.h"
|
||||
#import "flutter_cocos_widget-Swift.h"
|
||||
#endif
|
||||
|
||||
@implementation FlutterCocosWidgetPlugin {
|
||||
NSObject<FlutterPluginRegistrar>* _registrar;
|
||||
FlutterMethodChannel* _channel;
|
||||
NSMutableDictionary* _unityControllers;
|
||||
NSMutableDictionary* _cocosControllers;
|
||||
}
|
||||
|
||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
||||
|
Loading…
x
Reference in New Issue
Block a user