Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_18
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_18
Commits
2dd312e2
Commit
2dd312e2
authored
Dec 27, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
f15f001d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
18 deletions
+79
-18
.DS_Store
.DS_Store
+0
-0
OP_18.meta
assets/OP_18.meta
+15
-1
OP_18.js
assets/OP_18/scene/OP_18.js
+64
-17
No files found.
.DS_Store
View file @
2dd312e2
No preview for this file type
assets/OP_18.meta
View file @
2dd312e2
{"ver":"1.1.2","uuid":"e9f579c0-59b7-4567-93ad-5b17f799e827","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e9f579c0-59b7-4567-93ad-5b17f799e827",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/OP_18/scene/OP_18.js
View file @
2dd312e2
...
...
@@ -3722,52 +3722,99 @@ cc.Class({
const
rect
=
colorRect
.
ccRect
;
let
targetLabelText
=
colorRect
.
labelText
;
for
(
let
i
=
0
;
i
<
dotArr
.
length
;
i
++
)
{
let
{
dotRect
,
labelText
,
key
}
=
dotArr
[
i
];
const
checkIsContains
=
(
dotRect
,
labelText
,
key
)
=>
{
// console.log('targetLabelText.toLowerCase() : ', targetLabelText.toLowerCase() );
// console.log('labelText.toLowerCase() : ', labelText.toLowerCase() );
// console.log('rect.intersects(dotRect) : ', rect.intersects(dotRect) );
if
(
specialLetterArr
.
indexOf
(
labelText
)
!=
-
1
)
{
labelText
=
labelText
.
toLowerCase
();
targetLabelText
=
targetLabelText
.
toLowerCase
();
// console.log(' in small letter');
}
if
(
labelText
.
indexOf
(
targetLabelText
)
!=
-
1
&&
dotRect
.
intersects
(
rect
))
{
// if (labelText.indexOf(targetLabelText) != -1 && rect.intersects(dotRect)) {
// if (labelText.toLowerCase().indexOf(targetLabelText.toLowerCase()) != -1 && rect.intersects(dotRect)) {
const
len
=
targetLabelText
.
trim
().
length
;
// console.log('len: ', len);
if
(
!
answerData
[
key
])
{
answerData
[
key
]
=
{
colorRect
,
count
:
len
};
}
else
{
answerData
[
key
].
count
+=
len
;
// console.log('len: ', len);
// console.log(' answerData[key].count: ', answerData[key].count);
}
if
(
labelText
.
length
<=
1
)
{
answerData
[
key
].
isFinish
=
true
;
answerData
[
key
].
line
=
line
;
return
true
;
}
else
{
if
(
answerData
[
key
].
count
>=
labelText
.
length
)
{
answerData
[
key
].
isFinish
=
true
;
answerData
[
key
].
line
=
line
;
return
true
;
}
}
}
}
// return;
for
(
let
i
=
0
;
i
<
dotArr
.
length
;
i
++
)
{
let
{
dotRect
,
labelText
,
key
}
=
dotArr
[
i
];
// console.log('targetLabelText.toLowerCase() : ', targetLabelText.toLowerCase() );
// console.log('labelText.toLowerCase() : ', labelText.toLowerCase() );
// console.log('rect.intersects(dotRect) : ', rect.intersects(dotRect) );
if
(
labelText
.
indexOf
(
"
||
"
)
!=
-
1
)
{
const
labelTextArr
=
labelText
.
split
(
"
||
"
);
for
(
let
j
=
0
;
j
<
labelTextArr
.
length
;
j
++
)
{
const
isContains
=
checkIsContains
(
dotRect
,
labelTextArr
[
j
],
key
);
if
(
isContains
)
{
break
;
}
}
}
else
{
checkIsContains
(
dotRect
,
labelText
,
key
);
}
// if (specialLetterArr.indexOf(labelText) != -1 ) {
// labelText = labelText.toLowerCase();
// targetLabelText = targetLabelText.toLowerCase();
// // console.log(' in small letter');
// }
// if (labelText.indexOf(targetLabelText) != -1 && dotRect.intersects(rect)) {
// // if (labelText.indexOf(targetLabelText) != -1 && rect.intersects(dotRect)) {
// // if (labelText.toLowerCase().indexOf(targetLabelText.toLowerCase()) != -1 && rect.intersects(dotRect)) {
// const len = targetLabelText.trim().length;
// // console.log('len: ', len);
// if (!answerData[key]) {
// answerData[key] = {colorRect, count: len};
// } else {
// answerData[key].count += len;
// // console.log('len: ', len);
// // console.log(' answerData[key].count: ', answerData[key].count);
// }
// if ( labelText.length <= 1) {
// answerData[key].isFinish = true;
// answerData[key].line = line;
// } else {
// if (answerData[key].count >= labelText.length) {
// answerData[key].isFinish = true;
// answerData[key].line = line;
// }
// }
// // return;
// }
}
},
...
...
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