Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg29_museum
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
dg29_museum
Commits
5832d468
Commit
5832d468
authored
Dec 31, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码调整
parent
b31da49b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
145 deletions
+17
-145
dg29_museum.meta
assets/dg29_museum.meta
+15
-1
DG16.ts
assets/dg29_museum/DG16/scene/DG16.ts
+2
-144
No files found.
assets/dg29_museum.meta
View file @
5832d468
{"ver":"1.1.2","uuid":"39a67a55-d6ca-4302-bf68-bea091301858","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": "39a67a55-d6ca-4302-bf68-bea091301858",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/dg29_museum/DG16/scene/DG16.ts
View file @
5832d468
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util_DG16
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent_DG16
"
;
import
Boy
from
"
../script/ui/boy_DG16
"
;
import
QuestionView
from
"
../script/ui/question_DG16
"
;
import
videoCtrl
from
"
../script/ui/videoCtrl_DG16
"
;
import
pg
from
"
../../scene/pg_dg29_museum
"
;
import
dg29_museum_game
from
"
../../scene/dg29_museum_game
"
;
...
...
@@ -33,7 +31,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
qustionCom
:
QuestionView
=
null
;
//
qustionCom: QuestionView = null;
_totalIndex
:
any
;
_roundIndex
:
number
;
playGuide2
:
any
;
...
...
@@ -106,97 +104,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
initView
()
{
this
.
initBg
();
// this.btn_next.on("click", () => {
// this.playLocalAudio("btn")
// if (!cc.find('middleLayer')) {
// console.log("==点击了下一页按钮==")
// return;
// }
// const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
// middleLayer.goNextPage(); // 跳转到下一页
// }, this)
this
.
videoCtrl
.
active
=
false
;
this
.
qustionCom
=
this
.
qustionLayer
.
getComponent
(
QuestionView
);
// this._totalIndex = this.data.contentObj.dataArray.length;
this
.
_roundIndex
=
0
;
this
.
firstRound
=
true
this
.
doWrongTime
=
0
;
// cc.log(JSON.stringify(this.data, null, 2))
this
.
WrongList
=
[];
this
.
qustionCom
.
hide
();
// this.boyNode.x = cc.winSize.width;
// this.boyNode.getComponent(Boy).playRun(-1);
// cc.tween(this.boyNode).to(3, { x: 0 }).call(() => {
// this.boyNode.getComponent(Boy).playtalk(-1);
// this.playAudioByUrl(this.data.audio_url_guide, () => {
// this.boyNode.scaleX = -0.65;
// this.log("playRun start")
// this.boyNode.getComponent(Boy).playRun(-1);
// cc.tween(this.boyNode).to(1, { x: 500 }).call(() => {
// this.log("playRun end")
// this.boyNode.scaleX = 0.65;
// this.boyNode.getComponent(Boy).playNormal();
// this.qustionCom.show();
// this.doRound()
// }).start();
// })
// }).start()
}
doRound
()
{
if
(
this
.
_roundIndex
<
this
.
_totalIndex
)
{
let
data
=
this
.
data
.
contentObj
.
dataArray
[
this
.
_roundIndex
];
let
index
=
data
.
option_1_isRight
?
0
:
1
;
this
.
qustionCom
.
init
(
data
,
index
,
this
.
_roundIndex
+
1
,
this
.
_totalIndex
,
async
(
isRight
)
=>
{
if
(
isRight
)
{
this
.
playLocalAudio
(
"
right
"
);
this
.
boyNode
.
getComponent
(
Boy
).
playGood
(
1
);
}
else
{
this
.
WrongList
.
push
(
data
);
this
.
doWrongTime
++
;
this
.
playLocalAudio
(
"
wrong
"
)
this
.
boyNode
.
getComponent
(
Boy
).
playInvite
(
1
);
}
await
asyncDelay
(
1.5
)
this
.
doRound
();
})
this
.
_roundIndex
++
;
}
else
{
this
.
qustionCom
.
hide
()
this
.
boyNode
.
getComponent
(
Boy
).
playRun
(
-
1
);
cc
.
tween
(
this
.
boyNode
).
to
(
1
,
{
x
:
0
}).
call
(()
=>
{
this
.
boyNode
.
getComponent
(
Boy
).
playtalk
(
-
1
);
let
audiourl
=
this
.
doWrongTime
>
0
?
this
.
data
.
audio_url_wrong
:
this
.
data
.
audio_url_right
;
this
.
playAudioByUrl
(
audiourl
,
()
=>
{
this
.
boyNode
.
scaleX
=
-
0.65
;
this
.
boyNode
.
getComponent
(
Boy
).
playRun
(
-
1
);
cc
.
tween
(
this
.
boyNode
).
to
(
1
,
{
x
:
500
}).
call
(
async
()
=>
{
this
.
boyNode
.
scaleX
=
0.65
;
this
.
boyNode
.
getComponent
(
Boy
).
playNormal
();
this
.
playVideo
();
}).
start
();
})
}).
start
()
}
}
async
playVideo
()
{
this
.
videoCtrl
.
active
=
true
;
this
.
node
.
getChildByName
(
"
bg
"
).
active
=
false
;
...
...
@@ -209,52 +126,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
await
asyncDelay
(
0.1
);
this
.
boyNode
.
active
=
false
;
}
initWorongLogic
()
{
this
.
_totalIndex
=
this
.
WrongList
.
length
;
this
.
_roundIndex
=
0
;
this
.
qustionCom
.
show
();
this
.
doWrongRound
();
}
doWrongRound
()
{
if
(
this
.
_roundIndex
<
this
.
_totalIndex
)
{
let
data
=
this
.
WrongList
[
this
.
_roundIndex
];
let
index
=
data
.
option_1_isRight
?
0
:
1
;
this
.
qustionCom
.
init
(
data
,
index
,
this
.
_roundIndex
+
1
,
this
.
_totalIndex
,
async
(
isRight
)
=>
{
if
(
isRight
)
{
this
.
playLocalAudio
(
"
right
"
);
this
.
boyNode
.
getComponent
(
Boy
).
playGood
(
1
);
}
else
{
this
.
playLocalAudio
(
"
wrong
"
)
this
.
boyNode
.
getComponent
(
Boy
).
playInvite
(
1
);
}
await
asyncDelay
(
1.5
)
this
.
doWrongRound
();
})
this
.
_roundIndex
++
;
}
else
{
this
.
qustionCom
.
hide
();
this
.
boyNode
.
getComponent
(
Boy
).
playRun
(
-
1
);
cc
.
tween
(
this
.
boyNode
).
to
(
1
,
{
x
:
0
}).
call
(()
=>
{
this
.
boyNode
.
getComponent
(
Boy
).
playtalk
(
-
1
);
this
.
playAudioByUrl
(
this
.
data
.
audio_url_end
,
()
=>
{
this
.
boyNode
.
scaleX
=
-
0.65
;
this
.
boyNode
.
getComponent
(
Boy
).
playRun
(
-
1
);
cc
.
tween
(
this
.
boyNode
).
to
(
1
,
{
x
:
500
}).
call
(()
=>
{
this
.
boyNode
.
scaleX
=
0.65
;
this
.
boyNode
.
getComponent
(
Boy
).
playWave
(
-
1
);
this
.
btn_next
.
active
=
true
;
}).
start
();
})
}).
start
()
}
}
playLocalAudio
(
audioName
)
{
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
...
...
@@ -291,26 +162,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
if
(
event
===
cc
.
VideoPlayer
.
EventType
.
COMPLETED
)
{
this
.
videoCtrl
.
active
=
false
;
this
.
node
.
getChildByName
(
"
bg
"
).
active
=
true
;
cc
.
log
(
"
video completed
"
);
this
.
boyNode
.
active
=
true
;
this
.
vplayer
.
node
.
active
=
false
;
if
(
this
.
WrongList
.
length
>
0
)
{
this
.
initWorongLogic
();
}
else
{
this
.
boyNode
.
getComponent
(
Boy
).
playtalk
(
-
1
);
this
.
playAudioByUrl
(
this
.
data
.
audio_url_end
,
()
=>
{
this
.
boyNode
.
getComponent
(
Boy
).
playWave
(
-
1
);
this
.
btn_next
.
active
=
true
;
})
}
pg
.
event
.
emit
(
'
play_video_end
'
)
}
}
...
...
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