接入cocos的js引擎
This commit is contained in:
parent
7d17bf947c
commit
7304ab78d0
@ -39,6 +39,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
// we assume that app delegate is never changed and we can cache it, instead of re-query UIApplication every time
|
// we assume that app delegate is never changed and we can cache it, instead of re-query UIApplication every time
|
||||||
UnityAppController* _UnityAppController = nil;
|
UnityAppController* _UnityAppController = nil;
|
||||||
|
|
||||||
@ -94,6 +96,8 @@ NSInteger _forceInterfaceOrientationMask = 0;
|
|||||||
@synthesize interfaceOrientation = _curOrientation;
|
@synthesize interfaceOrientation = _curOrientation;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
cocos2d::Application* app = nullptr;
|
||||||
|
|
||||||
- (id)init
|
- (id)init
|
||||||
{
|
{
|
||||||
if ((self = _UnityAppController = [super init]))
|
if ((self = _UnityAppController = [super init]))
|
||||||
@ -255,6 +259,7 @@ extern "C" void UnityRequestQuit()
|
|||||||
if ([UIDevice currentDevice].generatesDeviceOrientationNotifications == NO)
|
if ([UIDevice currentDevice].generatesDeviceOrientationNotifications == NO)
|
||||||
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
|
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
|
||||||
#endif
|
#endif
|
||||||
|
app = new AppDelegate(1, 1);
|
||||||
|
|
||||||
UnityInitApplicationNoGraphics([[[NSBundle mainBundle] bundlePath] UTF8String]);
|
UnityInitApplicationNoGraphics([[[NSBundle mainBundle] bundlePath] UTF8String]);
|
||||||
|
|
||||||
@ -280,7 +285,7 @@ extern "C" void UnityRequestQuit()
|
|||||||
g.delaysTouchesBegan = false;
|
g.delaysTouchesBegan = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
app->start();
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
D5F2D102287C092D003C2B62 /* libcocos2d iOS.a in Frameworks */,
|
|
||||||
D5F2CFD0287BF80A003C2B62 /* libz.tbd in Frameworks */,
|
D5F2CFD0287BF80A003C2B62 /* libz.tbd in Frameworks */,
|
||||||
D5F2CFCE287BF7FE003C2B62 /* JavaScriptCore.framework in Frameworks */,
|
D5F2CFCE287BF7FE003C2B62 /* JavaScriptCore.framework in Frameworks */,
|
||||||
D5F2CFCC287BF7ED003C2B62 /* libsqlite3.tbd in Frameworks */,
|
D5F2CFCC287BF7ED003C2B62 /* libsqlite3.tbd in Frameworks */,
|
||||||
@ -500,6 +499,7 @@
|
|||||||
83B2574F0E63025400468741 /* libiconv.2.dylib in Frameworks */,
|
83B2574F0E63025400468741 /* libiconv.2.dylib in Frameworks */,
|
||||||
D0DD4D8D8AC82F06A4331428 /* libil2cpp.a in Frameworks */,
|
D0DD4D8D8AC82F06A4331428 /* libil2cpp.a in Frameworks */,
|
||||||
E9D340DABD2259166E8A82AF /* Metal.framework in Frameworks */,
|
E9D340DABD2259166E8A82AF /* Metal.framework in Frameworks */,
|
||||||
|
D5F2D102287C092D003C2B62 /* libcocos2d iOS.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
Binary file not shown.
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bucket
|
||||||
|
uuid = "B7D09DA6-0F18-414A-A80E-A05383BA2B01"
|
||||||
|
type = "1"
|
||||||
|
version = "2.0">
|
||||||
|
<Breakpoints>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "2A19FD93-1BCA-46F2-AD6D-D771B7C76268"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Classes/UnityAppController.mm"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "131"
|
||||||
|
endingLineNumber = "131"
|
||||||
|
landmarkName = "-startUnity:"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
</Breakpoints>
|
||||||
|
</Bucket>
|
Loading…
x
Reference in New Issue
Block a user