Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AK09
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
AK09
Commits
db3ff374
Commit
db3ff374
authored
May 06, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 不隐藏问题
parent
14dddb0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
34 deletions
+42
-34
AK09.js
play/assets/AK09/scene/AK09.js
+41
-33
config.json
publish/publish/config.json
+1
-1
No files found.
play/assets/AK09/scene/AK09.js
View file @
db3ff374
...
...
@@ -249,10 +249,12 @@ cc.Class({
next
();
});
window
.
courseware
.
onEvent
(
'
hideOption
'
,
(
data
,
next
)
=>
{
this
.
hideOption
();
this
.
updateStatus
(
data
.
status
);
next
();
});
window
.
courseware
.
onEvent
(
'
hideQuestion
'
,
(
data
,
next
)
=>
{
this
.
hideQuestion
();
this
.
updateStatus
(
data
.
status
);
next
();
});
...
...
@@ -294,27 +296,26 @@ cc.Class({
});
const
questionLayout
=
cc
.
find
(
'
Canvas/bg/book/question/questionNode/questionLayout
'
);
if
(
!
questionLayout
)
{
return
;
}
const
starOn
=
cc
.
find
(
'
starNode/ImageStarOn
'
,
questionLayout
);
const
starOff
=
cc
.
find
(
'
starNode/ImageStarOff
'
,
questionLayout
);
if
(
this
.
_status
.
quesion
.
selected
)
{
starOn
.
opacity
=
255
;
starOff
.
opacity
=
0
;
}
else
{
starOn
.
opacity
=
0
;
starOff
.
opacity
=
255
;
if
(
questionLayout
)
{
const
starOn
=
cc
.
find
(
'
starNode/ImageStarOn
'
,
questionLayout
);
const
starOff
=
cc
.
find
(
'
starNode/ImageStarOff
'
,
questionLayout
);
if
(
this
.
_status
.
quesion
.
selected
)
{
starOn
.
opacity
=
255
;
starOff
.
opacity
=
0
;
}
else
{
starOn
.
opacity
=
0
;
starOff
.
opacity
=
255
;
}
}
const
tipNode
=
cc
.
find
(
'
Canvas/bg/tips
'
);
const
btnNext
=
cc
.
find
(
'
Canvas/bg/btnNext
'
);
const
allOptionSelected
=
this
.
_status
.
options
.
all
(
optionData
=>
optionData
.
selected
);
const
allOptionSelected
=
this
.
_status
.
options
.
every
(
optionData
=>
optionData
.
selected
);
if
(
this
.
_status
.
quesion
.
selected
&&
allOptionSelected
)
{
tipNode
.
active
=
false
;
btnNext
.
active
=
true
;
btnNext
.
on
(
'
click
'
,
()
=>
{
});
}
else
{
btnNext
.
active
=
false
;
...
...
@@ -425,13 +426,13 @@ cc.Class({
await
asyncTweenTo
(
label
,
0.15
,
{
scale
:
1.1
},
{
easing
:
'
sineIn
'
});
await
asyncTweenTo
(
label
,
0.1
,
{
scale
:
1
},
{
easing
:
'
sineOut
'
});
await
asyncDelay
(
2
);
this
.
hideOption
();
this
.
sendServerEvent
(
'
hideOption
'
,
{
data
:
{
idx
:
idx
},
status
:
this
.
_status
});
},
hideOption
()
{
const
idx
=
this
.
_status
.
currentShowOptionIdx
;
if
(
idx
===
null
)
{
console
.
log
(
'
idx =
'
+
idx
);
return
;
}
...
...
@@ -450,15 +451,17 @@ cc.Class({
const
movePos
=
maskBase
.
convertToNodeSpaceAR
(
optionBase
.
convertToWorldSpaceAR
(
optionNode
.
oldPosition
)
);
cc
.
tween
(
optionNode
)
.
to
(
0.6
,
{
x
:
movePos
.
x
,
y
:
movePos
.
y
,
scale
:
1
},
{
easing
:
'
sineInOut
'
})
.
call
(()
=>
{
optionNode
.
parent
=
optionBase
;
optionNode
.
setPosition
(
optionNode
.
oldPosition
);
})
.
start
();
this
.
_status
.
currentShowOptionIdx
=
null
;
if
(
!
optionNode
.
hideAction
)
{
optionNode
.
hideAction
=
cc
.
tween
(
optionNode
)
.
to
(
0.6
,
{
x
:
movePos
.
x
,
y
:
movePos
.
y
,
scale
:
1
},
{
easing
:
'
sineInOut
'
})
.
call
(()
=>
{
optionNode
.
parent
=
optionBase
;
optionNode
.
setPosition
(
optionNode
.
oldPosition
);
optionNode
.
hideAction
=
null
;
this
.
_status
.
currentShowOptionIdx
=
null
;
})
.
start
();
}
},
async
showQuestion
()
{
...
...
@@ -495,12 +498,14 @@ cc.Class({
await
asyncTweenTo
(
label
,
0.2
,
{
scale
:
1.0
},
{
easing
:
'
sineInOut
'
});
}
await
asyncDelay
(
2
);
this
.
hideQuestion
();
this
.
sendServerEvent
(
'
hideQuestion
'
,
{
data
:
null
,
status
:
this
.
_status
});
},
async
hideQuestion
()
{
const
questionNode
=
cc
.
find
(
'
Canvas/bg/maskBase/questionNode
'
);
if
(
!
questionNode
)
{
return
;
}
const
mask
=
cc
.
find
(
'
Canvas/bg/maskBase/mask
'
);
cc
.
tween
(
mask
).
to
(
0.5
,
{
opacity
:
0
}).
start
();
...
...
@@ -514,15 +519,18 @@ cc.Class({
questionBase
.
convertToWorldSpaceAR
(
questionNode
.
oldPosition
)
);
cc
.
tween
(
questionNode
)
.
to
(
0.6
,
{
x
:
newPos
.
x
,
y
:
newPos
.
y
,
scale
:
1
},
{
easing
:
'
sineInOut
'
})
.
call
(()
=>
{
questionNode
.
parent
=
questionBase
;
questionNode
.
x
=
questionNode
.
oldPosition
.
x
;
questionNode
.
y
=
questionNode
.
oldPosition
.
y
;
this
.
_status
.
currentShowQuestion
=
false
;
})
.
start
();
if
(
!
questionNode
.
hideAction
)
{
questionNode
.
hideAction
=
cc
.
tween
(
questionNode
)
.
to
(
0.6
,
{
x
:
newPos
.
x
,
y
:
newPos
.
y
,
scale
:
1
},
{
easing
:
'
sineInOut
'
})
.
call
(()
=>
{
questionNode
.
parent
=
questionBase
;
questionNode
.
x
=
questionNode
.
oldPosition
.
x
;
questionNode
.
y
=
questionNode
.
oldPosition
.
y
;
this
.
_status
.
currentShowQuestion
=
false
;
questionNode
.
hideAction
=
null
;
})
.
start
();
}
},
playAudioByNodeName
(
name
)
{
...
...
publish/publish/config.json
View file @
db3ff374
{
"ios"
:{
"sceneName"
:
"AK09"
,
"version"
:
"f9be7"
},
"android"
:{
"sceneName"
:
"AK09"
,
"version"
:
"f9be7"
}}
\ No newline at end of file
{
"ios"
:{
"sceneName"
:
"AK09"
,
"version"
:
"b2a2b"
},
"android"
:{
"sceneName"
:
"AK09"
,
"version"
:
"b2a2b"
}}
\ No newline at end of file
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