Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
debug_shell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
debug_shell
Commits
375e6467
Commit
375e6467
authored
Dec 06, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
af47150b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
oxford_front.ts
play/assets/oxford_front/scene/oxford_front.ts
+45
-2
No files found.
play/assets/oxford_front/scene/oxford_front.ts
View file @
375e6467
...
@@ -62,10 +62,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -62,10 +62,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
_mapScaleMin
:
number
=
1
;
_mapScaleMin
:
number
=
1
;
_mapScaleMax
:
number
=
1
;
_mapScaleMax
:
number
=
1
;
_cocosScale
:
number
=
1
;
_cocosScale
:
number
=
1
;
BASE_URL
:
string
=
null
;
MACHINE_INITED
:
boolean
=
false
;
onLoad
(){
onLoad
(){
this
.
tws
=
[];
this
.
tws
=
[];
this
.
LoadingCount
=
0
;
this
.
LoadingCount
=
0
;
this
.
initSize
();
this
.
initSize
();
}
initialized
()
{
if
(
this
.
BASE_URL
&&
this
.
gameMachineService
)
{
this
.
gameMachineService
.
start
();
this
.
restore
();
}
}
callOcMethod
(
method
,
param
)
{
const
paramStr
=
JSON
.
stringify
(
param
);
if
(
cc
.
sys
.
isNative
&&
cc
.
sys
.
os
==
cc
.
sys
.
OS_IOS
)
{
return
jsb
.
reflection
.
callStaticMethod
(
'
CocosMng
'
,
`
${
method
}
:`
,
paramStr
);
}
else
if
(
cc
.
sys
.
isNative
&&
cc
.
sys
.
os
==
cc
.
sys
.
OS_ANDROID
)
{
return
jsb
.
reflection
.
callStaticMethod
(
'
com/iplayabc/cocos/AppActivity
'
,
method
,
'
(Ljava/lang/String;)Ljava/lang/String;
'
,
paramStr
);
}
else
if
(
cc
.
sys
.
isNative
&&
cc
.
sys
.
os
==
cc
.
sys
.
OS_WINDOWS
)
{
console
.
log
(
'
汪汪汪
'
)
}
else
{
throw
(
'
非源生环境
'
);
}
}
}
initSize
()
{
initSize
()
{
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
...
@@ -137,7 +161,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -137,7 +161,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
},
this
,
true
);
},
this
,
true
);
});
});
}
}
globalThis
.
aaa
=
this
;
globalThis
.
aaa
=
this
;
const
that
=
this
;
// @ts-ignores
window
.
air
.
getEngineInfoCallback
=
function
({
isDev
}
)
{
console
.
log
(
isDev
);
if
(
isDev
)
{
this
.
BASE_URL
=
'
https://staging-teach.ireadabc.com
'
;
}
else
{
this
.
BASE_URL
=
'
https://iteachabc.com
'
;
}
console
.
log
(
111111
);
that
.
initialized
();
}
// @ts-ignores
const
success
=
this
.
callOcMethod
(
'
getEngineInfo
'
);
if
(
success
)
{
console
.
log
(
"
callOcMethod('getEngineInfo') success
"
+
success
);
}
else
{
console
.
log
(
"
callOcMethod('getEngineInfo') error
"
+
success
);
}
}
}
initBg
()
{
initBg
()
{
// const bgNode = cc.find('Canvas/MainScene/SpaceView/bg');
// const bgNode = cc.find('Canvas/MainScene/SpaceView/bg');
...
@@ -500,8 +544,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -500,8 +544,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
gameMachineService
=
interpret
(
operationMachine
).
onTransition
((
state
)
=>
{
this
.
gameMachineService
=
interpret
(
operationMachine
).
onTransition
((
state
)
=>
{
// console.log(1, state);
// console.log(1, state);
});
});
this
.
gameMachineService
.
start
();
this
.
restore
();
}
}
restore
()
{
restore
()
{
if
(
globalThis
.
PREV_STATE
)
{
if
(
globalThis
.
PREV_STATE
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment