Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_Pronunciation
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
Sbx_Pronunciation
Commits
faa9641b
Commit
faa9641b
authored
Dec 21, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Plain Diff
fix: 闪屏测试
parents
1472461c
e88c2d9c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
24 deletions
+39
-24
Sbx_Pronunciation.meta
assets/Sbx_Pronunciation.meta
+1
-15
Sbx_Pronunciation.js
assets/Sbx_Pronunciation/scene/Sbx_Pronunciation.js
+6
-0
Cartoon.js
assets/Sbx_Pronunciation/script/Cartoon.js
+16
-5
GameLogic.js
assets/Sbx_Pronunciation/script/GameLogic.js
+16
-4
No files found.
assets/Sbx_Pronunciation.meta
View file @
faa9641b
{
{"ver":"1.1.2","uuid":"f6e31e97-ccb9-4c5f-a2fa-b4eed558e692","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
"ver": "1.1.2",
\ No newline at end of file
"uuid": "f6e31e97-ccb9-4c5f-a2fa-b4eed558e692",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/Sbx_Pronunciation/scene/Sbx_Pronunciation.js
View file @
faa9641b
...
@@ -89,6 +89,8 @@ cc.Class({
...
@@ -89,6 +89,8 @@ cc.Class({
onDestory
()
{
onDestory
()
{
cc
.
audioEngine
.
stopAll
()
cc
.
audioEngine
.
stopAll
()
this
.
gameLogic
.
destroy
()
},
},
getData
(
func
)
{
getData
(
func
)
{
...
@@ -106,6 +108,10 @@ cc.Class({
...
@@ -106,6 +108,10 @@ cc.Class({
func
(
this
.
getDefaultData
());
func
(
this
.
getDefaultData
());
},
},
<<<<<<<
HEAD
=======
>>>>>>>
e88c2d9cbb93dd63b82666ce50372da1e3cc16f1
getDefaultData
()
{
getDefaultData
()
{
const
dataJson
=
'
{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","theme":"D","border_image_url":"","video_image_url":"","text_image_url":"","dataArray":[{"video_url":"http://staging-teach.cdn.ireadabc.com/16eace86b47925cc644797cecd37b03b.mp4","textDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/e74e4ffcb5c7b3321b448c93969541cd.png","name":"kkKoala_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/fca011e0fe39287dc8dd2cd44c0ef7ed.json","name":"kkKoala_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/d825a8ed1199f157800e11ddb9954146.json","name":"kkKoala_ske.json"}},"rightDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/aedca82ee5031ab43082c7a08a79b3d6.png","name":"蚂蚁骨骼_animation_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/f86dd94a9d56eab7c5f257abc600a577.json","name":"蚂蚁骨骼_animation_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/5482364adfb24d2b0f627f2767167f4b.json","name":"蚂蚁骨骼_animation_ske.json"}},"rightType":"image","image_url":"http://staging-teach.cdn.ireadabc.com/863035154daca76366204c0d4dddee51.png"}]}}
'
const
dataJson
=
'
{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","theme":"D","border_image_url":"","video_image_url":"","text_image_url":"","dataArray":[{"video_url":"http://staging-teach.cdn.ireadabc.com/16eace86b47925cc644797cecd37b03b.mp4","textDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/e74e4ffcb5c7b3321b448c93969541cd.png","name":"kkKoala_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/fca011e0fe39287dc8dd2cd44c0ef7ed.json","name":"kkKoala_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/d825a8ed1199f157800e11ddb9954146.json","name":"kkKoala_ske.json"}},"rightDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/aedca82ee5031ab43082c7a08a79b3d6.png","name":"蚂蚁骨骼_animation_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/f86dd94a9d56eab7c5f257abc600a577.json","name":"蚂蚁骨骼_animation_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/5482364adfb24d2b0f627f2767167f4b.json","name":"蚂蚁骨骼_animation_ske.json"}},"rightType":"image","image_url":"http://staging-teach.cdn.ireadabc.com/863035154daca76366204c0d4dddee51.png"}]}}
'
...
...
assets/Sbx_Pronunciation/script/Cartoon.js
View file @
faa9641b
...
@@ -174,13 +174,24 @@ export default class Cartoon {
...
@@ -174,13 +174,24 @@ export default class Cartoon {
}
}
}
}
_timeoutIds
=
[]
_intervalIds
=
[]
destroy
()
{
this
.
_timeoutIds
.
forEach
(
id
=>
{
clearTimeout
(
id
);
});
this
.
_intervalIds
.
forEach
(
id
=>
{
clearInterval
(
id
);
});
}
playVideo
(
videoPlayer
,
callback
)
{
playVideo
(
videoPlayer
,
callback
)
{
if
(
videoPlayer
&&
videoPlayer
.
isPlaying
)
{
if
(
videoPlayer
&&
videoPlayer
.
isPlaying
)
{
videoPlayer
.
stop
()
videoPlayer
.
stop
()
}
}
if
(
videoPlayer
)
{
if
(
videoPlayer
)
{
setTimeout
(()
=>
{
this
.
_timeoutIds
(
setTimeout
(()
=>
{
videoPlayer
.
play
()
videoPlayer
.
play
()
videoPlayer
.
node
.
off
(
"
completed
"
)
videoPlayer
.
node
.
off
(
"
completed
"
)
videoPlayer
.
node
.
on
(
"
completed
"
,
()
=>
{
videoPlayer
.
node
.
on
(
"
completed
"
,
()
=>
{
...
@@ -188,7 +199,7 @@ export default class Cartoon {
...
@@ -188,7 +199,7 @@ export default class Cartoon {
callback
()
callback
()
}
}
})
})
},
50
)
},
50
)
)
}
}
}
}
...
@@ -397,9 +408,9 @@ class DragonBones {
...
@@ -397,9 +408,9 @@ class DragonBones {
let
sx
=
parentNode
.
width
/
animaNode
.
width
;
//
let sx = parentNode.width / animaNode.width;
let
sy
=
parentNode
.
height
/
animaNode
.
height
;
//
let sy = parentNode.height / animaNode.height;
animaNode
.
setScale
(
Math
.
min
(
sx
,
sy
));
//
animaNode.setScale(Math.min(sx, sy));
if
(
callback
)
{
if
(
callback
)
{
callback
(
this
)
callback
(
this
)
}
}
...
...
assets/Sbx_Pronunciation/script/GameLogic.js
View file @
faa9641b
...
@@ -452,16 +452,16 @@ export default class GameLogic {
...
@@ -452,16 +452,16 @@ export default class GameLogic {
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
)
{
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
)
{
this
.
m_currentQuestion
=
this
.
g_formData
.
dataArray
.
length
-
1
this
.
m_currentQuestion
=
this
.
g_formData
.
dataArray
.
length
-
1
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
(
false
)
resolve
(
false
)
},
20
);
},
20
)
)
;
});
});
}
else
if
(
this
.
m_currentQuestion
<=
-
1
)
{
}
else
if
(
this
.
m_currentQuestion
<=
-
1
)
{
this
.
m_currentQuestion
=
0
;
this
.
m_currentQuestion
=
0
;
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
(
false
)
resolve
(
false
)
},
20
);
},
20
)
)
;
});
});
}
}
...
@@ -720,4 +720,16 @@ export default class GameLogic {
...
@@ -720,4 +720,16 @@ export default class GameLogic {
console
.
log
(
`Click enabled! [
${
eventName
}
]`
)
console
.
log
(
`Click enabled! [
${
eventName
}
]`
)
}
}
_timeoutIds
=
[]
_intervalIds
=
[]
destroy
()
{
this
.
g_cartoon
.
destroy
();
this
.
_timeoutIds
.
forEach
(
id
=>
{
clearTimeout
(
id
);
});
this
.
_intervalIds
.
forEach
(
id
=>
{
clearInterval
(
id
);
});
}
}
}
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