Commit 2b248b4a authored by liujiangnan's avatar liujiangnan

feat: 过度动画

parent 14dddb0a
This diff is collapsed.
{
"ver": "1.1.2",
"uuid": "efa27dc4-6c0e-4984-85d9-20f634267476",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{"name":"pageturn","version":"5.5","frameRate":24,"armature":[{"name":"Armature","animation":[{"name":"pageturn","frame":[],"ik":[],"duration":34,"slot":[{"name":"外圈","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":4},{"tweenEasing":0,"duration":12,"color":{"aM":52}},{"tweenEasing":0,"duration":4,"color":{"aM":0}},{"duration":0,"color":{"aM":0}}]},{"name":"星2","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":6},{"tweenEasing":0,"duration":14,"color":{"aM":62}},{"duration":0,"color":{"aM":0}}]},{"name":"三角","displayFrame":[],"colorFrame":[{"duration":16},{"tweenEasing":0,"duration":18},{"duration":0,"color":{"aM":0}}]},{"name":"星1","displayFrame":[],"colorFrame":[{"duration":14},{"tweenEasing":0,"duration":20},{"duration":0,"color":{"aM":0}}]},{"name":"中间","displayFrame":[],"colorFrame":[{"duration":22},{"tweenEasing":0,"duration":12},{"duration":0,"color":{"aM":0}}]},{"name":"光","displayFrame":[{"duration":10,"value":-1},{"duration":24}],"colorFrame":[{"duration":10},{"tweenEasing":0,"duration":16,"color":{"aM":0}},{"tweenEasing":0,"duration":4,"color":{"aM":0}},{"tweenEasing":0,"duration":4},{"duration":0}]}],"bone":[{"name":"root","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"中间","rotateFrame":[{"tweenEasing":0,"rotate":-58.1972,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":12,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":6,"x":1.3,"tweenEasing":0,"y":1.3},{"duration":0}],"translateFrame":[{"duration":5,"curve":[0,0,0.5,1],"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"星1","rotateFrame":[{"tweenEasing":0,"rotate":30.7638,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4,"tweenEasing":0},{"duration":6},{"duration":14,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":0,"x":0.5,"y":0.5}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"三角","rotateFrame":[{"tweenEasing":0,"rotate":18.9253,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":24,"tweenEasing":0},{"duration":0}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":40},{"duration":24}]},{"name":"星2","rotateFrame":[{"tweenEasing":0,"rotate":-40.7489,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":14,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":0,"x":0.5,"y":0.5}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"外圈","rotateFrame":[{"tweenEasing":0,"rotate":84.1193,"duration":10},{"duration":24}],"scaleFrame":[{"duration":10},{"duration":4},{"duration":4,"tweenEasing":0},{"duration":12,"x":1.2,"tweenEasing":0,"y":1.2},{"duration":4,"x":0.55,"tweenEasing":0,"y":0.55},{"duration":0,"x":0.55,"y":0.55}],"translateFrame":[{"duration":5,"tweenEasing":0,"y":300},{"duration":5,"tweenEasing":0,"y":-40},{"duration":24}]},{"name":"光","rotateFrame":[],"scaleFrame":[{"duration":10},{"duration":16,"x":0.2,"tweenEasing":0,"y":0.2},{"duration":8,"x":0.2,"tweenEasing":0,"y":0.2},{"duration":0,"x":2.42,"y":1.34}],"translateFrame":[]}],"playTimes":0,"ffd":[]},{"name":"pageturn2","frame":[],"ik":[],"duration":12,"slot":[{"name":"外圈","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"星2","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"三角","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"星1","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"中间","displayFrame":[{"duration":12,"value":-1}],"colorFrame":[]},{"name":"光","displayFrame":[],"colorFrame":[{"tweenEasing":0,"duration":12},{"duration":0,"color":{"aM":0}}]}],"bone":[{"name":"root","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"中间","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"星1","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"三角","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"星2","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"外圈","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"光","rotateFrame":[],"scaleFrame":[{"duration":12,"x":2.42,"y":1.34}],"translateFrame":[]}],"playTimes":0,"ffd":[]}],"slot":[{"name":"光","color":{},"parent":"光"},{"name":"外圈","color":{},"z":1,"parent":"外圈"},{"name":"星2","color":{},"z":2,"parent":"星2"},{"name":"三角","color":{},"z":3,"parent":"三角"},{"name":"星1","color":{},"z":4,"parent":"星1"},{"name":"中间","color":{},"z":5,"parent":"中间"}],"ik":[],"skin":[{"name":"","slot":[{"name":"三角","display":[{"name":"魔法阵/三角","transform":{},"type":"image","path":"魔法阵/三角"}]},{"name":"星2","display":[{"name":"魔法阵/星2","transform":{},"type":"image","path":"魔法阵/星2"}]},{"name":"外圈","display":[{"name":"魔法阵/外圈","transform":{},"type":"image","path":"魔法阵/外圈"}]},{"name":"光","display":[{"name":"魔法阵/光","transform":{},"type":"image","path":"魔法阵/光"}]},{"name":"中间","display":[{"name":"魔法阵/中间","transform":{},"type":"image","path":"魔法阵/中间"}]},{"name":"星1","display":[{"name":"魔法阵/星1","transform":{},"type":"image","path":"魔法阵/星1"}]}]}],"defaultActions":[{"gotoAndPlay":"pageturn"}],"frameRate":24,"bone":[{"name":"root","transform":{}},{"name":"中间","transform":{},"parent":"root"},{"name":"星1","transform":{},"parent":"root"},{"name":"三角","transform":{},"parent":"root"},{"name":"星2","transform":{},"parent":"root"},{"name":"外圈","transform":{},"parent":"root"},{"name":"光","transform":{},"parent":"root"}],"type":"Armature","aabb":{"x":-527,"height":1054,"y":-527,"width":1054}}],"isGlobal":0}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "e94099fa-4527-437e-8c04-ec177da7d8c8",
"subMetas": {}
}
\ No newline at end of file
{"name":"pageturn","imagePath":"pageturn_tex.png","height":2048,"SubTexture":[{"name":"魔法阵/光","x":1,"height":1054,"y":1,"width":1054},{"name":"魔法阵/外圈","x":1,"height":519,"y":1057,"width":519},{"name":"魔法阵/星2","x":1,"height":424,"y":1578,"width":424},{"name":"魔法阵/三角","x":427,"height":409,"y":1578,"width":405},{"name":"魔法阵/星1","x":834,"height":322,"y":1578,"width":322},{"name":"魔法阵/中间","x":1158,"height":229,"y":1578,"width":229}],"width":2048}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "5f555255-c47f-4781-ac69-88e853b9aeab",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "48fe9eb1-2787-4926-921a-c61fc17d3371",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"pageturn_tex": {
"ver": "1.0.4",
"uuid": "b46a06c8-3d46-4303-9b59-e074c0468aa0",
"rawTextureUuid": "48fe9eb1-2787-4926-921a-c61fc17d3371",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -330,
"offsetY": 22.5,
"trimX": 1,
"trimY": 1,
"width": 1386,
"height": 2001,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 107 "__id__": 111
}, },
{ {
"__id__": 109 "__id__": 113
}, },
{ {
"__id__": 111 "__id__": 115
}, },
{ {
"__id__": 113 "__id__": 117
} }
], ],
"_active": false, "_active": false,
...@@ -85,22 +85,25 @@ ...@@ -85,22 +85,25 @@
}, },
{ {
"__id__": 96 "__id__": 96
},
{
"__id__": 104
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 104 "__id__": 108
}, },
{ {
"__id__": 105 "__id__": 109
}, },
{ {
"__id__": 106 "__id__": 110
} }
], ],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 0,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
...@@ -5257,6 +5260,232 @@ ...@@ -5257,6 +5260,232 @@
}, },
"_id": "0bNdPv3K1CubNfgwCtNZnD" "_id": "0bNdPv3K1CubNfgwCtNZnD"
}, },
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 105
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "a5YJ4CMBFNlqrxpFnvIqk+"
},
{
"__type__": "cc.Node",
"_name": "anima",
"_objFlags": 0,
"_parent": {
"__id__": 104
},
"_children": [
{
"__id__": 106
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "d0q2ESjZZOjrFAQORdq85T"
},
{
"__type__": "cc.Node",
"_name": "pageturn",
"_objFlags": 0,
"_parent": {
"__id__": 105
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 107
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1054,
"height": 1054
},
"_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": "e8JbdJxIVHMpolAdB8BG2E"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 106
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "e94099fa-4527-437e-8c04-ec177da7d8c8#5f555255-c47f-4781-ac69-88e853b9aeab",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "e94099fa-4527-437e-8c04-ec177da7d8c8"
},
"_N$dragonAtlasAsset": {
"__uuid__": "5f555255-c47f-4781-ac69-88e853b9aeab"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "a6FLxLYYZHe7moTRC9tEg9"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
...@@ -5322,7 +5551,7 @@ ...@@ -5322,7 +5551,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 108 "__id__": 112
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5378,7 +5607,7 @@ ...@@ -5378,7 +5607,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 107 "__id__": 111
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -5419,7 +5648,7 @@ ...@@ -5419,7 +5648,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 110 "__id__": 114
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5475,7 +5704,7 @@ ...@@ -5475,7 +5704,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 109 "__id__": 113
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -5513,7 +5742,7 @@ ...@@ -5513,7 +5742,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 112 "__id__": 116
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5569,7 +5798,7 @@ ...@@ -5569,7 +5798,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 111 "__id__": 115
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -5594,7 +5823,7 @@ ...@@ -5594,7 +5823,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 114 "__id__": 118
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5650,7 +5879,7 @@ ...@@ -5650,7 +5879,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 113 "__id__": 117
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
......
...@@ -54,6 +54,7 @@ cc.Class({ ...@@ -54,6 +54,7 @@ cc.Class({
aspectStatus: null, aspectStatus: null,
// 生命周期 start // 生命周期 start
isTeacher: null,
start() { start() {
let getData = this.getData.bind(this); let getData = this.getData.bind(this);
if (window && window.courseware) { if (window && window.courseware) {
...@@ -62,6 +63,9 @@ cc.Class({ ...@@ -62,6 +63,9 @@ cc.Class({
getData((data, aspect) => { getData((data, aspect) => {
console.log('data:', data); console.log('data:', data);
if (window['air']?.airClassInfo?.user?.classRole == 'tea') {
this.isTeacher = true;
}
this.data = data || this.getDefaultData(); this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data)) this.data = JSON.parse(JSON.stringify(this.data))
...@@ -111,6 +115,12 @@ cc.Class({ ...@@ -111,6 +115,12 @@ cc.Class({
}, },
addPreloadImage() { addPreloadImage() {
const arr = this.data.options;
if (arr) {
for (let i=0; i<arr.length; i++) {
this._imageResList.push({ url: arr[i].image });
}
}
// this._imageResList.push({ url: this.data.pic_url }); // this._imageResList.push({ url: this.data.pic_url });
}, },
...@@ -122,11 +132,60 @@ cc.Class({ ...@@ -122,11 +132,60 @@ cc.Class({
}, },
addServerListener() {
const c = window.courseware;
if (!c) {
return;
}
c.onEvent('course-in-screen', (data, next) => {
cc.find('Canvas').opacity = 255;
this.showTemplateStartAnima();
this.loadEnd();
next();
});
},
showTemplateStartAnima() {
const resDragonBone = cc.find("Canvas/res/anima/pageturn")
const pageturn = cc.instantiate(resDragonBone)
const canvas = cc.find('Canvas');
canvas.addChild(pageturn, 100);
const dragonDisplay = pageturn.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.on(dragonBones.EventObject.COMPLETE, () => {
pageturn.removeFromParent();
})
dragonDisplay.playAnimation('pageturn2', 1);
},
showTemplateEndAnima() {
const resDragonBone = cc.find("Canvas/res/anima/pageturn")
const pageturn = cc.instantiate(resDragonBone)
const canvas = cc.find('Canvas');
canvas.addChild(pageturn, 100);
const dragonDisplay = pageturn.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.on(dragonBones.EventObject.COMPLETE, () => {
cc.tween({})
.delay(1)
.call(() => {
if (window && window.courseware && this.isTeacher) {
window.courseware.nextPage();
}
})
.start();
})
dragonDisplay.playAnimation('pageturn', 1);
},
preload() { preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList); const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => { cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.loadEnd(); console.log('this.loadEnd();');
this.addServerListener();
if (window && window["air"]) { if (window && window["air"]) {
window["air"].hideAirClassLoading(); window["air"].hideAirClassLoading();
} }
...@@ -293,6 +352,15 @@ cc.Class({ ...@@ -293,6 +352,15 @@ cc.Class({
} }
}); });
const allOptionSelected = this._status.options.every(optionData => optionData.selected);
if (this._status.quesion.selected && allOptionSelected) {
cc.tween({}).delay(2).call(() => {
this.showTemplateEndAnima();
}).start();
}
const questionLayout = cc.find('Canvas/bg/book/question/questionNode/questionLayout'); const questionLayout = cc.find('Canvas/bg/book/question/questionNode/questionLayout');
if (!questionLayout) { if (!questionLayout) {
return; return;
...@@ -307,18 +375,6 @@ cc.Class({ ...@@ -307,18 +375,6 @@ cc.Class({
starOff.opacity = 255; 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);
if (this._status.quesion.selected && allOptionSelected) {
tipNode.active = false;
btnNext.active = true;
btnNext.on('click', () => {
});
} else {
btnNext.active = false;
}
}, },
initOptions() { initOptions() {
......
No preview for this file type
...@@ -8,11 +8,11 @@ node build_check.js ...@@ -8,11 +8,11 @@ node build_check.js
set +e set +e
cd ../form # cd ../form
npm install # npm install
npm run publish # npm run publish
cd ../publish cd ../publish
......
{"ios":{"sceneName":"AK09","version":"f9be7"},"android":{"sceneName":"AK09","version":"f9be7"}} {"ios":{"sceneName":"AK09","version":"850d9"},"android":{"sceneName":"AK09","version":"850d9"}}
\ No newline at end of file \ No newline at end of file
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