Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
DuibaGameTemplate
Commits
f0a8bbb3
Commit
f0a8bbb3
authored
Oct 27, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
16714916
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
649 additions
and
8 deletions
+649
-8
ResJson.ts
src/ResJson.ts
+646
-7
SoundWeb.ts
src/SoundWeb.ts
+3
-1
No files found.
src/ResJson.ts
View file @
f0a8bbb3
This diff is collapsed.
Click to expand it.
src/SoundWeb.ts
View file @
f0a8bbb3
...
@@ -63,7 +63,9 @@ export function playSound(src: string, loop: boolean = false) {
...
@@ -63,7 +63,9 @@ export function playSound(src: string, loop: boolean = false) {
//循环的,且有缓存,取缓存的
//循环的,且有缓存,取缓存的
if
(
soundHash
[
src
]
&&
loop
)
sound
=
soundHash
[
src
]
if
(
soundHash
[
src
]
&&
loop
)
sound
=
soundHash
[
src
]
//没有就新建
//没有就新建
if
(
!
sound
)
sound
=
new
window
[
'Howl'
]({
src
:
[
src
],
autoplay
:
false
,
loop
});
if
(
!
sound
)
sound
=
new
window
[
'Howl'
]({
src
:
[
src
],
autoplay
:
false
,
loop
,
volume
:
src
===
Soundurl
.
moonCakeOut
?
0.6
:
1
});
//记录下,方便停止
//记录下,方便停止
soundHash
[
src
]
=
sound
;
soundHash
[
src
]
=
sound
;
//不循环删除缓存
//不循环删除缓存
...
...
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