Commit 4b1cb842 authored by limingzhe's avatar limingzhe

feat: 跳转

parent 77b49669
{
"ver": "1.1.2",
"uuid": "7248bbf0-06a3-4a69-b9e7-f057b4461178",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "9d28773b-d69f-4fc8-b675-16fde99a4712",
"subMetas": {}
}
\ No newline at end of file
{"name":"徽章动画","height":1024,"SubTexture":[{"name":"bg","x":1009,"height":10,"y":505,"width":10},{"name":"图层_2","x":1,"height":700,"y":1,"width":700},{"name":"G","x":875,"height":107,"y":505,"width":89},{"name":"o","x":948,"height":84,"y":832,"width":70},{"name":"o_0","x":953,"height":84,"y":614,"width":70},{"name":"d","x":875,"height":107,"y":723,"width":76},{"name":"j","x":953,"height":119,"y":700,"width":44},{"name":"o_1","x":875,"height":84,"y":832,"width":71},{"name":"b","x":875,"height":107,"y":614,"width":76},{"name":"左侧领结","x":703,"height":175,"y":505,"width":170},{"name":"右侧领结","x":703,"height":174,"y":682,"width":170},{"name":"徽章","x":703,"height":250,"y":1,"width":274},{"name":"星星1","x":1,"height":66,"y":918,"width":66},{"name":"星星2","x":966,"height":41,"y":505,"width":41},{"name":"徽章1","x":703,"height":250,"y":253,"width":274}],"imagePath":"徽章动画_tex.png","width":1024}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f615b7c8-a715-4f8d-88f6-c6b0765ede74",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ad6b2c47-bec6-41c0-8fd8-7dca5c5a597a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 1024,
"platformSettings": {},
"subMetas": {
"徽章动画_tex": {
"ver": "1.0.4",
"uuid": "25c6fcbf-e76b-4a52-bff2-8f2f1dea945a",
"rawTextureUuid": "ad6b2c47-bec6-41c0-8fd8-7dca5c5a597a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 19.5,
"trimX": 1,
"trimY": 1,
"width": 1022,
"height": 983,
"rawWidth": 1024,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -76,18 +76,21 @@
},
{
"__id__": 8
},
{
"__id__": 10
}
],
"_active": true,
"_components": [
{
"__id__": 34
"__id__": 36
},
{
"__id__": 35
"__id__": 37
},
{
"__id__": 36
"__id__": 38
}
],
"_prefab": null,
......@@ -368,6 +371,108 @@
"_N$enableBatch": false,
"_id": "b5ZWY5+bFE3YNqJ+CrU6nq"
},
{
"__type__": "cc.Node",
"_name": "goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 700,
"height": 700
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f23hV9mnBBYZ1OXVQg3VZs"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "armatureName",
"_animationName": "newAnimation",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "9d28773b-d69f-4fc8-b675-16fde99a4712#f615b7c8-a715-4f8d-88f6-c6b0765ede74",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "9d28773b-d69f-4fc8-b675-16fde99a4712"
},
"_N$dragonAtlasAsset": {
"__uuid__": "f615b7c8-a715-4f8d-88f6-c6b0765ede74"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "66t644bDFDb73XispqPIHj"
},
{
"__type__": "cc.Node",
"_name": "res",
......@@ -377,13 +482,13 @@
},
"_children": [
{
"__id__": 9
"__id__": 11
},
{
"__id__": 24
"__id__": 26
},
{
"__id__": 27
"__id__": 29
}
],
"_active": false,
......@@ -441,12 +546,9 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 10
},
"_children": [
{
"__id__": 12
},
......@@ -464,6 +566,9 @@
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_active": true,
......@@ -521,13 +626,13 @@
"_name": "go_1",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
"__id__": 13
}
],
"_prefab": null,
......@@ -583,7 +688,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
"__id__": 12
},
"_enabled": true,
"_materials": [],
......@@ -611,13 +716,13 @@
"_name": "black",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 15
}
],
"_prefab": null,
......@@ -673,7 +778,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 14
},
"_enabled": true,
"_materials": [],
......@@ -701,13 +806,13 @@
"_name": "go_3",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
"__id__": 17
}
],
"_prefab": null,
......@@ -763,7 +868,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 16
},
"_enabled": true,
"_materials": [],
......@@ -791,13 +896,13 @@
"_name": "go_2",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
"__id__": 19
}
],
"_prefab": null,
......@@ -853,7 +958,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 18
},
"_enabled": true,
"_materials": [],
......@@ -881,13 +986,13 @@
"_name": "start_title",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 21
}
],
"_prefab": null,
......@@ -943,7 +1048,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 20
},
"_enabled": true,
"_materials": [],
......@@ -971,13 +1076,13 @@
"_name": "go_0",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 23
}
],
"_prefab": null,
......@@ -1033,7 +1138,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
"__id__": 22
},
"_enabled": true,
"_materials": [],
......@@ -1061,13 +1166,13 @@
"_name": "light",
"_objFlags": 0,
"_parent": {
"__id__": 9
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 25
}
],
"_prefab": null,
......@@ -1123,7 +1228,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 24
},
"_enabled": true,
"_materials": [],
......@@ -1151,11 +1256,11 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 10
},
"_children": [
{
"__id__": 25
"__id__": 27
}
],
"_active": true,
......@@ -1213,13 +1318,13 @@
"_name": "GOTHICB_1",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 26
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
"__id__": 28
}
],
"_prefab": null,
......@@ -1275,7 +1380,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 27
},
"_enabled": true,
"_materials": [
......@@ -1310,17 +1415,17 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 10
},
"_children": [
{
"__id__": 28
},
{
"__id__": 30
},
{
"__id__": 32
},
{
"__id__": 34
}
],
"_active": true,
......@@ -1378,13 +1483,13 @@
"_name": "goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
"__id__": 31
}
],
"_prefab": null,
......@@ -1440,7 +1545,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 30
},
"_enabled": true,
"_clip": {
......@@ -1459,13 +1564,13 @@
"_name": "ready",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 33
}
],
"_prefab": null,
......@@ -1521,7 +1626,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 32
},
"_enabled": true,
"_clip": {
......@@ -1540,13 +1645,13 @@
"_name": "go",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 35
}
],
"_prefab": null,
......@@ -1602,7 +1707,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
"__id__": 34
},
"_enabled": true,
"_clip": {
......
......@@ -335,19 +335,19 @@ cc.Class({
checkIsFirst() {
return true;
return false;
},
checkIsLast() {
return false;
return true;
},
checkPlayTimes() {
return 0;
return 1;
},
getJumpData() {
return //{step: 2};
return {step: 1};
},
maskSpr: null,
......@@ -394,9 +394,11 @@ initMask() {
isFirstVideoPlayEnd: null,
isLocal: null,
initData() {
this.isLocal = true;
this.quesIndex = 0;
this.curEndTime = -1;
......@@ -404,7 +406,7 @@ initMask() {
if (this.data.jumpTime) {
this.initQuesIndex();
this.jumpTime = Number(this.data.jumpTime);
}
......@@ -412,10 +414,13 @@ initMask() {
this.initAudioEffect();
},
initQuesIndex() {
resetQuesIndex() {
this.quesIndex = -1;
for (let i=0; i<this.data.quesArr.length; i++) {
const checkTime = this.data.quesArr[i].ques_start;
if (Number(this.data.jumpTime) > Number(checkTime)) {
if (Number(this.jumpTime) >= Number(checkTime)) {
this.quesIndex = i;
} else {
return;
......@@ -503,11 +508,6 @@ initMask() {
if (this.isFirst) {
this.initStartView();
return;
}
},
......@@ -864,7 +864,7 @@ showStartLight() {
}
},
startQuesVideo() {
startQuesVideo(currentTime = null) {
console.log(' in startQuesVideo')
this.wrongTimes = 0;
......@@ -874,8 +874,19 @@ showStartLight() {
console.log("this.curQues: ", this.curQues);
if (currentTime) {
video.currentTime = currentTime;
} else {
video.currentTime = Number(this.curQues.ques_start);
}
if (this.playTimes > 0) {
if (this.curQues) {
this.curEndTime = Number(this.curQues.ques_end);
}
}
delayCall(0.01, () => {
video.play();
......@@ -1083,11 +1094,9 @@ showStartLight() {
video.node.isLoadEnd = true;
video.pause();
// this.startQuesVideo();
this.videoLoadEnd();
if (this.data.jumpTime) {
video.currentTime = Number(this.data.jumpTime);
}
// this.startQuesVideo();
} else {
checkIsPlaying();
......@@ -1098,13 +1107,49 @@ showStartLight() {
video.node.on('completed', () => {
console.log(' in completed!!!!');
this.curVideoPlayEnd();
if (this.isLast && this.playTimes > 0) {
this.showGoodjob();
} else {
this.showMask(() => {
if (!this.isLocal) {
callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
}
})
}
// this.curVideoPlayEnd();
})
return video.node;
},
showGoodjob() {
const goodjob = cc.find("Canvas/goodjob");
goodjob.zIndex = 15;
goodjob.active = true;
goodjob.scale = this._mapScaleMin;
const dragonDisplay = goodjob.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('newAnimation', 1);
playAudio(this.goodjobClip, async () => {
await asyncDelay(3);
console.log(' end .....');
this.showMask(() => {
if (!this.isLocal) {
callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
}
})
});
},
getColorRect(w, h) {
const node = new cc.Node();
const ctx = node.addComponent(cc.Graphics);
......@@ -1114,7 +1159,58 @@ showStartLight() {
return node;
},
videoLoadEnd() {
if (this.jumpData) {
this.setJumpTime();
}
if (this.jumpTime) {
this.resetQuesIndex();
this.initCurQues();
} else if (this.isFirst) {
this.initStartView();
return;
}
this.startQuesVideo(this.jumpTime);
},
setJumpTime() {
let isFind = false;
for (let i=0; i<this.data.quesArr.length; i++) {
const id = i;
if (id == this.jumpData.step) {
const quesData = this.data.quesArr[i];
this.jumpTime = Number( quesData.ques_start );
isFind = true;
break;
}
}
if (!isFind) {
const lastQuesData = this.data.quesArr[this.data.quesArr.length - 1];
this.jumpTime = lastQuesData.ques_end;
}
},
curVideoPlayEnd() {
if (this.playTimes == 0) {
return;
}
switch (this.video.node.name) {
case "ques_video":
this.startWaitVideo();
......@@ -1140,6 +1236,17 @@ showStartLight() {
},
showMask(cb) {
const mask = this.maskSpr;
mask.opacity = 0;
cc.tween(mask)
.to(0.2, {opacity: 255}, {easing: "sineIn"})
.call(() => {
cb && cb();
})
.start();
},
......@@ -2552,7 +2659,7 @@ showStartLight() {
rectNode.anchorX = rectNode.anchorY = 0;
if (quesData.bgItem.isShowDebugLine || true) {
if (quesData.bgItem.isShowDebugLine || this.data.isDebug) {
ctx.rect(0, 0, rectNode.width, rectNode.height);
}
ctx.stroke();
......@@ -2592,8 +2699,16 @@ showStartLight() {
// this.startWrongVideo();
// }
const id = data.index;
bg.active = false;
this.hand.active = false;
this.showMask(() => {
if (!this.isLocal) {
callMiddleLayerFunction('PSQS_jump_to_question', {step: id}, null)
}
})
});
return rectNode;
......
......@@ -103,6 +103,11 @@
<div style="margin-top: 30px">
<span>快速跳转到:</span> <input type="text" nz-input [(ngModel)]="item.jumpTime" (blur)="save()" style="width: 100px;">
</div>
<div style="margin-top: 30px; width: 200px; height: 50px; border: 1px solid #ccc ; border-radius: 5px; display: flex; align-items: center; justify-content: center;">
<label nz-checkbox [(ngModel)]="item.isDebug" (ngModelChange)="save()">调试模式</label>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment