Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
liwei_test_009
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
liwei_test_009
Commits
653eb5e9
Commit
653eb5e9
authored
Nov 20, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
9d8d72dc
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
902 additions
and
104 deletions
+902
-104
liwei_test_009.fire
assets/liwei_test_009/scene/liwei_test_009.fire
+879
-103
liwei_test_009.ts
assets/liwei_test_009/scene/liwei_test_009.ts
+23
-1
No files found.
assets/liwei_test_009/scene/liwei_test_009.fire
View file @
653eb5e9
This diff is collapsed.
Click to expand it.
assets/liwei_test_009/scene/liwei_test_009.ts
View file @
653eb5e9
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util_liwei_test_009
"
;
import
{
asyncDelay
,
onHomeworkFinish
,
playAudio
,
playAudioByUrl
}
from
"
../script/util_liwei_test_009
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent_liwei_test_009
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -17,6 +17,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
}
playAudio_1
()
{
playAudioByUrl
(
"
http://teach.cdn.ireadabc.com/oxford_voice/9964dc0b22d5b624/1700453035537.mp3
"
,
()
=>
{
console
.
log
(
"
Done
"
)})
}
playAudio_2
()
{
this
.
getAudioClipByUrl
(
"
http://teach.cdn.ireadabc.com/oxford_voice/9964dc0b22d5b624/1700453035537.mp3
"
,
(
clip
)
=>
{
playAudio
(
clip
)
})
}
getAudioClipByUrl
(
audioUrl
,
cb
)
{
console
.
log
(
audioUrl
)
if
(
audioUrl
)
{
// 三秒超时 最大尝试三次重连
cc
.
assetManager
.
loadRemote
(
audioUrl
,
(
err
,
audioClip
)
=>
{
console
.
log
(
err
)
cb
&&
cb
(
audioClip
);
});
}
},
addPreloadAnima
()
{
}
...
...
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