Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP71
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
OP71
Commits
22ac4079
Commit
22ac4079
authored
Nov 14, 2022
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整逻辑
parent
69d6c00c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
42 deletions
+46
-42
OP71.ts
assets/OP71/scene/OP71.ts
+3
-20
Entites.ts
assets/OP71/script/Entites.ts
+27
-7
PicArea.ts
assets/OP71/script/PicArea.ts
+16
-15
No files found.
assets/OP71/scene/OP71.ts
View file @
22ac4079
...
@@ -262,7 +262,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -262,7 +262,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
else
if
(
this
.
playTimes
>=
this
.
MAX_PLAY_TIMES
)
{
else
if
(
this
.
playTimes
>=
this
.
MAX_PLAY_TIMES
)
{
//显示下一行
//显示下一行
this
.
wordArea2
.
show
(()
=>
{
this
.
wordArea2
.
show
(()
=>
{
this
.
play2
(
0
);
this
.
wordArea2
.
click
(()
=>
{
this
.
showEnd
();
});
});
});
...
@@ -276,25 +278,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -276,25 +278,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
}
}
play2
(
index
=
0
)
{
let
wordArea
=
this
.
wordArea2
;
let
word
=
wordArea
.
wordArr
[
index
];
word
.
show
();
word
.
click
(()
=>
{
if
(
index
===
this
.
wordArea2
.
wordArr
.
length
-
1
){
this
.
showEnd
();
}
else
{
word
.
hide
();
this
.
play2
(
index
+
1
);
}
});
}
/**
/**
* 显示结束画
* 显示结束画
...
...
assets/OP71/script/Entites.ts
View file @
22ac4079
...
@@ -125,10 +125,9 @@ export class Word extends Item {
...
@@ -125,10 +125,9 @@ export class Word extends Item {
//播放音频
//播放音频
if
(
this
.
_audioClip
)
{
if
(
this
.
_audioClip
)
{
this
.
_cat
.
playAni
(
'
begin
'
,
0
);
playAudio
(
this
.
_audioClip
,
()
=>
{
playAudio
(
this
.
_audioClip
,
()
=>
{
this
.
_cat
.
playAni
(
'
normal
'
,
0
);
});
});
}
}
...
@@ -337,10 +336,10 @@ export class Word2 extends Item {
...
@@ -337,10 +336,10 @@ export class Word2 extends Item {
//播放音频
//播放音频
if
(
this
.
_audioClip
)
{
if
(
this
.
_audioClip
)
{
this
.
_cat
.
playAni
(
'
begin
'
,
0
);
playAudio
(
this
.
_audioClip
,
()
=>
{
playAudio
(
this
.
_audioClip
,
()
=>
{
this
.
_cat
.
playAni
(
'
normal
'
,
0
);
});
});
}
}
...
@@ -449,9 +448,30 @@ export class WordArea2 extends WordGroup {
...
@@ -449,9 +448,30 @@ export class WordArea2 extends WordGroup {
}
}
click
(
cb
=
null
)
{
click
(
cb
=
null
)
{
let
word
=
this
.
wordArr
[
2
];
word
.
click
(
cb
);
for
(
let
i
=
0
;
i
<
this
.
wordArr
.
length
;
++
i
){
this
.
wordArr
[
i
].
hide
();
}
const
play2
=
(
index
=
0
)
=>
{
let
word
=
this
.
wordArr
[
index
];
word
.
show
();
word
.
click
(()
=>
{
if
(
index
===
this
.
wordArr
.
length
-
1
){
cb
&&
cb
();
}
else
{
word
.
hide
();
play2
(
index
+
1
);
}
});
};
play2
();
}
}
}
}
...
...
assets/OP71/script/PicArea.ts
View file @
22ac4079
...
@@ -12,12 +12,14 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
...
@@ -12,12 +12,14 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
private
_audioUrl
:
string
;
private
_audioUrl
:
string
;
//晃动最大次数
//晃动最大次数
readonly
MAX_TIMES
=
2
;
readonly
MAX_TIMES
=
1
;
private
_audioClip
:
cc
.
AudioClip
;
private
_audioClip
:
cc
.
AudioClip
;
private
_cat
:
Cat
;
private
_cat
:
Cat
;
private
_initScale
=
1
;
set
picUrl
(
picUrl
:
string
)
{
set
picUrl
(
picUrl
:
string
)
{
this
.
_picUrl
=
picUrl
;
this
.
_picUrl
=
picUrl
;
}
}
...
@@ -80,6 +82,8 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
...
@@ -80,6 +82,8 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
picNode
.
x
=
0
;
picNode
.
x
=
0
;
picNode
.
y
=
0
;
picNode
.
y
=
0
;
pic
.
addChild
(
picNode
);
pic
.
addChild
(
picNode
);
this
.
_initScale
=
scale
;
});
});
}
}
...
@@ -98,39 +102,36 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
...
@@ -98,39 +102,36 @@ import { delayCall, getSprNodeByUrl, playAudio } from "./util";
//动画时长
//动画时长
let
tweenDuration
=
0.4
;
let
tweenDuration
=
0.4
;
let
rotation
=
this
.
_node
.
angle
;
let
times
=
1
;
let
times
=
1
;
const
rota
=
()
=>
{
const
enlarge
=
()
=>
{
cc
.
tween
(
this
.
_node
)
cc
.
tween
(
this
.
_node
)
.
to
(
tweenDuration
/
4
,
{
angle
:
rotation
-
15
})
.
to
(
tweenDuration
/
2
,
{
scale
:
this
.
_initScale
*
1.5
})
.
to
(
tweenDuration
/
4
,
{
angle
:
rotation
})
.
to
(
tweenDuration
/
2
,
{
scale
:
this
.
_initScale
})
.
to
(
tweenDuration
/
4
,
{
angle
:
rotation
+
15
})
.
to
(
tweenDuration
/
4
,
{
angle
:
rotation
})
.
call
(()
=>
{
.
call
(()
=>
{
times
+=
1
;
if
(
times
>
this
.
MAX_TIMES
)
{
if
(
times
>
this
.
MAX_TIMES
)
{
this
.
_canTouch
=
true
;
this
.
_canTouch
=
true
;
return
;
return
;
}
}
times
+=
1
;
enlarge
();
rota
();
})
})
.
start
();
.
start
();
}
}
//
晃动
图片
//
放大
图片
rota
();
enlarge
();
//播放音频
//播放音频
if
(
this
.
_audioClip
)
{
if
(
this
.
_audioClip
)
{
this
.
_cat
.
playAni
(
'
begin
'
,
0
);
//
this._cat.playAni('begin', 0);
playAudio
(
this
.
_audioClip
,
()
=>
{
playAudio
(
this
.
_audioClip
,
()
=>
{
this
.
_cat
.
playAni
(
'
normal
'
,
0
);
//
this._cat.playAni('normal', 0);
});
});
}
}
...
...
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