Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_01
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
op_01
Commits
1853fd32
Commit
1853fd32
authored
Sep 23, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
bb8de8e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
op_01.js
play/assets/op_01/scene/op_01.js
+7
-9
No files found.
play/assets/op_01/scene/op_01.js
View file @
1853fd32
...
...
@@ -142,31 +142,29 @@ cc.Class({
initView
()
{
this
.
coolCatSpeakStart
(()
=>
{
});
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
bg
=
cc
.
find
(
'
Canvas/bg/ImgBg
'
);
this
.
loadSpriteByUrl
(
bg
,
this
.
data
.
bgItem
.
url
,
()
=>
{
bg
.
scale
=
Math
.
min
((
canvas
.
width
/
bg
.
width
),
(
canvas
.
height
/
bg
.
height
));
this
.
itemList
=
[];
this
.
data
.
hotZoneItemArr
.
forEach
(
async
itemData
=>
{
const
item
=
await
this
.
createItem
(
itemData
,
bg
);
this
.
itemList
=
this
.
data
.
hotZoneItemArr
.
map
(
async
itemData
=>
await
this
.
createItem
(
itemData
,
bg
));
this
.
itemList
.
forEach
(
item
=>
{
item
.
on
(
'
click
'
,
()
=>
{
playAudioByUrl
(
itemData
.
audio_url
);
const
time
=
0.05
;
item
.
clicked
=
true
;
if
(
this
.
itemList
.
every
(
item
=>
i
tem
.
clicked
))
{
if
(
this
.
itemList
.
every
(
tmpItem
=>
tmpI
tem
.
clicked
))
{
this
.
coolCatSpeakEnd
();
}
playAudioByUrl
(
itemData
.
audio_url
);
const
time
=
0.05
;
cc
.
tween
(
item
)
.
to
(
time
,
{
angle
:
10
})
.
to
(
time
*
2
,
{
angle
:
-
10
})
.
to
(
time
,
{
angle
:
0
})
.
start
();
});
this
.
itemList
.
push
(
item
);
});
})
});
},
...
...
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