Commit e6acc55c authored by limingzhe's avatar limingzhe

fix: debug

parent 16767ee2
No preview for this file type
{"ver":"1.1.2","uuid":"b6f40990-0ee0-498b-b54d-392341efc239","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":"96c862fd-2801-4660-8d86-100b8dd357fe","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": "07e7e636-ec65-440a-82bd-4f2d12a41704",
"uuid": "35e587ab-eac7-41e2-b92b-1b58d2d6dc3d",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.0.1",
"uuid": "567718b3-c4f7-4b84-b648-ecc79a7449c9",
"uuid": "d812a687-11c5-4606-b36c-ab62d1165379",
"downloadMode": 0,
"duration": 1.1755,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "61f682d5-620c-46dd-b6fd-cf1da132729a",
"uuid": "f536b2b6-39b1-4915-a95e-1d7fa2217722",
"downloadMode": 0,
"duration": 5.112,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "fab432ab-c793-4f11-b42a-e8f7e3425ac5",
"uuid": "4399801d-481d-4cc1-97b1-2897dd8eb8e3",
"downloadMode": 0,
"duration": 4.362449,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "e76ea485-aded-4d87-8021-60a01ba20581",
"uuid": "f3b9a85f-1fb9-4492-816a-389f94a21208",
"downloadMode": 0,
"duration": 2.592,
"subMetas": {}
......
{
"ver": "1.1.2",
"uuid": "a038a43d-63d1-414a-adf8-8e4e475d2e8c",
"uuid": "08a317c1-5f1f-49fc-baa4-1a1278c166d6",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "e5584559-7515-434e-8719-a1c6dec48497",
"uuid": "37c41956-ec96-47ea-aa29-bdce07b57b44",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.1",
"uuid": "66fedfeb-3076-4e13-88ab-075bb9ff2fb5",
"uuid": "07ba5742-acc9-43b9-9c29-d895a75bd4dd",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4f992300-a90f-421e-9555-4ce9e590384f",
"uuid": "96388440-355d-4ad9-a582-a2c5a81ed77c",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "15a6fc66-112a-467d-a6e8-d54f1fd39c70",
"uuid": "e5a3d7c5-00d4-4d5b-a29c-732da2bc4e20",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"徽章动画_tex": {
"ver": "1.0.4",
"uuid": "953543ca-d98a-4d73-a38e-dd20edc7c8d0",
"rawTextureUuid": "15a6fc66-112a-467d-a6e8-d54f1fd39c70",
"uuid": "ec7c6a07-91be-4be4-acb3-619acb5293a4",
"rawTextureUuid": "e5a3d7c5-00d4-4d5b-a29c-732da2bc4e20",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "1.1.2",
"uuid": "e893e705-5a4b-4c13-90e9-7ae6ce10357a",
"uuid": "8030826f-40d7-4663-b6dd-e5a969b81f3d",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.1",
"uuid": "b46a56ea-663a-491c-b7f3-e223580b7ca2",
"uuid": "204fabf9-f391-408b-a2f5-31fc8c548354",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "0b490c1c-d4b5-41d7-83d8-ce0c738f06a2",
"uuid": "f7832634-9083-4273-86be-0a187982e88d",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a9550316-0d61-46ff-9b05-3138c210b91f",
"uuid": "f52aa1b5-edae-4bb2-9f75-f7e55c18cd81",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"hand_tex": {
"ver": "1.0.4",
"uuid": "cab7450b-11c2-408c-a798-d33034355c19",
"rawTextureUuid": "a9550316-0d61-46ff-9b05-3138c210b91f",
"uuid": "a8614d56-f8a1-44ed-95c9-49843570ae8a",
"rawTextureUuid": "f52aa1b5-edae-4bb2-9f75-f7e55c18cd81",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "1.1.2",
"uuid": "ed8af457-252b-4fa9-9837-dfbe2b260adb",
"uuid": "b683cbe0-d3bf-4ff5-ad0d-96b0be700f5b",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.0",
"uuid": "3727a686-68f2-4cbc-93ea-adbc22109b31",
"uuid": "6b49732c-fb0c-420f-af0e-c5308c7b4020",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "2c276722-0cb4-42e2-a766-fc77b7740e13",
"uuid": "907cb0bd-5bea-422f-9d93-df3b3312cc64",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "86d761fd-3419-4725-98b8-e2f85f758995",
"uuid": "d951eb95-a862-4ab9-b8a5-f66ab2f95595",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
......@@ -57,8 +57,8 @@
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "543f75c9-48ab-4029-90ab-47d502dc703b"
"autoReleaseAssets": false,
"_id": "9ff21de2-ae3e-4903-b997-099e269bc7ef"
},
{
"__type__": "cc.Node",
......@@ -320,7 +320,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "b46a56ea-663a-491c-b7f3-e223580b7ca2#0b490c1c-d4b5-41d7-83d8-ce0c738f06a2",
"_armatureKey": "204fabf9-f391-408b-a2f5-31fc8c548354#f7832634-9083-4273-86be-0a187982e88d",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -328,10 +328,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "b46a56ea-663a-491c-b7f3-e223580b7ca2"
"__uuid__": "204fabf9-f391-408b-a2f5-31fc8c548354"
},
"_N$dragonAtlasAsset": {
"__uuid__": "0b490c1c-d4b5-41d7-83d8-ce0c738f06a2"
"__uuid__": "f7832634-9083-4273-86be-0a187982e88d"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
......@@ -422,7 +422,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "66fedfeb-3076-4e13-88ab-075bb9ff2fb5#4f992300-a90f-421e-9555-4ce9e590384f",
"_armatureKey": "07ba5742-acc9-43b9-9c29-d895a75bd4dd#96388440-355d-4ad9-a582-a2c5a81ed77c",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -430,10 +430,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "66fedfeb-3076-4e13-88ab-075bb9ff2fb5"
"__uuid__": "07ba5742-acc9-43b9-9c29-d895a75bd4dd"
},
"_N$dragonAtlasAsset": {
"__uuid__": "4f992300-a90f-421e-9555-4ce9e590384f"
"__uuid__": "96388440-355d-4ad9-a582-a2c5a81ed77c"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
......@@ -655,7 +655,7 @@
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "3727a686-68f2-4cbc-93ea-adbc22109b31"
"__uuid__": "6b49732c-fb0c-420f-af0e-c5308c7b4020"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
......@@ -748,7 +748,7 @@
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "2c276722-0cb4-42e2-a766-fc77b7740e13"
"__uuid__": "907cb0bd-5bea-422f-9d93-df3b3312cc64"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
......@@ -919,7 +919,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "da8f0dec-acf7-4074-aecf-af21edda9770"
"__uuid__": "ef85a365-b549-4634-b77c-49c73499acaf"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1009,7 +1009,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1cdc48e6-d317-4d28-9d8e-3a939c787046"
"__uuid__": "0058ee41-02be-4173-bd18-94182d12a46c"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1099,7 +1099,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e508ee82-6457-45d6-a336-001a08e56421"
"__uuid__": "0013f3d4-495d-4da1-b04e-f31da30b47b2"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1189,7 +1189,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0bbe544e-bb4f-49e4-8b15-30d1465bcfb3"
"__uuid__": "f6b4b111-644c-45af-8a90-9947af521c96"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1279,7 +1279,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "520d6f56-91fe-404d-87d6-f4fa8b9f4637"
"__uuid__": "13b4bbd9-22d2-46fb-8b2e-c55b4443956d"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1369,7 +1369,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5676975d-02a5-4e6d-9ac4-f2a5a8aee8a9"
"__uuid__": "931ef3ef-9945-4451-8002-828ec2df017f"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1459,7 +1459,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f3b11cb3-ca2f-4159-94b9-f9e9d84509ca"
"__uuid__": "6af3a593-2795-42a4-b4b6-2efcef71e07b"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1549,7 +1549,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c9a07b9c-1eee-4ccb-8e6d-923de0688268"
"__uuid__": "d98a1baa-8483-4873-bbe4-02bbfe5f6e69"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1704,7 +1704,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "e76ea485-aded-4d87-8021-60a01ba20581"
"__uuid__": "f3b9a85f-1fb9-4492-816a-389f94a21208"
},
"_volume": 1,
"_mute": false,
......@@ -1785,7 +1785,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "61f682d5-620c-46dd-b6fd-cf1da132729a"
"__uuid__": "f536b2b6-39b1-4915-a95e-1d7fa2217722"
},
"_volume": 1,
"_mute": false,
......@@ -1866,7 +1866,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "fab432ab-c793-4f11-b42a-e8f7e3425ac5"
"__uuid__": "4399801d-481d-4cc1-97b1-2897dd8eb8e3"
},
"_volume": 1,
"_mute": false,
......@@ -1921,7 +1921,7 @@
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "0a9b6kzGbNChY20hLs8ttSf",
"__type__": "4b04cH+OJpPUpv2W5niClFI",
"_name": "",
"_objFlags": 0,
"node": {
......
{
"ver": "1.2.9",
"uuid": "543f75c9-48ab-4029-90ab-47d502dc703b",
"uuid": "9ff21de2-ae3e-4903-b997-099e269bc7ef",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"autoReleaseAssets": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -18,7 +18,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadAnima() {
console.log('this.data: ', this.data);
console.log('this.data: ' + JSON.stringify(this.data));
if (this.data?.skeJsonData?.url) {
this.data.skeJsonData.url += '?time=' + new Date().getTime()
this.data.texJsonData.url += '?time=' + new Date().getTime()
this.data.texPngData.url += '?time=' + new Date().getTime()
}
this._animaResList.push({ url: this.data.skeJsonData.url || '' });
this._animaResList.push({ url: this.data.texJsonData.url || ''});
this._animaResList.push({ url: this.data.texPngData.url || ''});
......@@ -27,8 +34,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
console.log(' in onLoadEnd 1')
this.initData();
console.log(' in onLoadEnd 2')
let isDataLoaded = false;
let isAnimLoaded = false;
const checkStart = () => {
......@@ -46,12 +57,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.getState(() => {
isDataLoaded = true;
checkStart();
})
this.setOneAnima(this.data, () => {
isAnimLoaded = true;
checkStart();
});
})
}
......@@ -62,6 +75,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
getState(cb) {
console.log(' in getState 1');
// this.isFirst = this.checkIsFirst();
// this.isLast = this.checkIsLast();
// this.playTimes = this.checkPlayTimes();
......@@ -69,11 +84,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
// cb && cb();
// return;
callMiddleLayerFunction('PSQS_get_course_info', {}, (data) => {
console.log(' in getState 2');
this.isFirst = data.first; //this.checkIsFirst();
this.isLast = data.last // this.checkIsLast();
this.playTimes = data.playTime // this.checkPlayTimes();
this.playTimes = data.playTime + 1 // this.checkPlayTimes();
this.jumpData = data.saveData // this.getJumpData();
if (this.data.isDebug) {
......@@ -162,7 +181,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
console.log( ' in initView')
if (this.jumpData) {
this.junpAnim();
return;
......@@ -379,8 +397,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
audioClip;
startAnim() {
if (this.animaNode) {
this.dragonDisplay.playAnimation(this.animaNode.animationNames[0], 1);
this.dragonDisplay.timeScale = 1;
}
// this.playAudioByUrl(this.data.lrcData.audio_url);
......@@ -389,6 +410,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
this.audioClip = audioClip;
});
}
showHand(id) {
......@@ -397,6 +420,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (stepData['X'] == 0 && stepData['Y'] == 0) {
console.log('stepData: ', stepData);
this.changeToMiddleLayer();
// this.delayDeleteAnim();
callMiddleLayerFunction('PSQS_jump_to_question', {step: id}, null)
return;
}
......@@ -424,20 +453,94 @@ export default class SceneComponent extends MyCocosSceneComponent {
// ctx.fillRect(-boxLen/2, -boxLen/2, boxLen, boxLen);
// ctx.fill();
let isClicked = false;
clickBox.on('touchstart', () => {
if (isClicked) {
return;
}
isClicked = true;
console.log('PSQS_show_rabbit 1');
// callMiddleLayerFunction('PSQS_show_rabbit', null, () => {
this.changeToMiddleLayer();
console.log('in changeToMiddleLayer1 ');
// this.delayDeleteAnim();
console.log('PSQS_show_rabbit 2')
callMiddleLayerFunction('PSQS_jump_to_question', {step: id}, null)
// })
})
}
delayDeleteAnim() {
this.cleanListener();
const middleLayer = <any>cc.find("middleLayer");
if (middleLayer) {
middleLayer.myAnimNode = null;
let dragonDisplay = this.animaNode.getComponent(dragonBones.ArmatureDisplay);
const oldAtlas = dragonDisplay.dragonAtlasAsset;
const oldAsset = dragonDisplay.dragonAsset;
this.delayRelease(oldAtlas, oldAsset, this.animaNode);
console.log(' setOneAnima 101')
this.animaNode.removeComponent(dragonBones.ArmatureDisplay)
dragonDisplay = this.animaNode.addComponent(dragonBones.ArmatureDisplay);
const handBase = cc.find("Canvas/hand");
const hand = cc.instantiate(handBase);
hand.active = true;
const handDisplay = hand.getComponent(dragonBones.ArmatureDisplay)
// const atlas = new dragonBones.DragonBonesAtlasAsset();
// const asset = new dragonBones.DragonBonesAsset();
dragonDisplay.dragonAtlasAsset = handDisplay.dragonAtlasAsset;
dragonDisplay.dragonAsset = handDisplay.dragonAsset;
console.log('汪汪汪 21')
oldAsset.decRef();
oldAsset.decRef();
oldAsset.decRef();
oldAsset.decRef();
oldAsset.decRef();
oldAsset.decRef();
// this.changeToMiddleLayer();
// this.delayRelease(oldAtlas, oldAsset);
}
}
cleanListener() {
this.dragonDisplay.off(dragonBones.EventObject.COMPLETE)
this.dragonDisplay.off(dragonBones.EventObject.FRAME_EVENT)
this.animaNode.off('touchstart');
}
jumpAudio(id) {
console.log('in jumpAudio id: ', id);
const stepData = this.data.stepArr[id-1];
console.log('stepData: ', stepData);
const time = stepData.text / this.data.frame;
cc.assetManager.loadRemote(this.data.lrcData.audio_url, (err, audioClip) => {
......@@ -453,7 +556,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
console.log(' in continueAnim')
this.dragonDisplay.timeScale = 1;
// this.dragonDisplay.timeScale = 1;
callMiddleLayerFunction('PSQS_hide_rabbit', null, () => {
......@@ -471,6 +574,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this.jumpData) {
console.log('this.jumpData: ', this.jumpData);
if (id == this.jumpData.step) {
this.dragonDisplay.timeScale = 0;
this.continueAnim(id);
this.jumpData = null;
}
......@@ -481,6 +587,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.dragonDisplay.timeScale = 0;
cc.audioEngine.pauseAllEffects();
this.showHand(id);
}
......@@ -527,31 +635,115 @@ export default class SceneComponent extends MyCocosSceneComponent {
console.log(' in animPlayEnd 1')
// callMiddleLayerFunction('PSQS_show_rabbit', null, () => {
this.changeToMiddleLayer();
console.log(' in animPlayEnd 2')
// setTimeout(() => {
callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
// }, 100);
// callMiddleLayerFunction('PSQS_play_animate_over', this.animaNode, () => {})
// })
}
changeToMiddleLayer() {
this.cleanListener();
const middleLayer = <any>cc.find("middleLayer");
if (middleLayer) {
// middleLayer.myAnimNode.parent = middleLayer
// this.animaNode.updateScale(middleLayer);
console.log('in changeToMiddleLayer1 ');
const cScale = this.animaNode.parent.scale;
const mScale = middleLayer.scale;
this.animaNode.scale = cScale / mScale * this._mapScaleMax;
if (this.data.scale) {
this.animaNode.scale *= this.data.scale;
}
this.dragonDisplay.dragonAtlasAsset.addRef();
this.dragonDisplay.dragonAsset.addRef();
// setTimeout(() => {
console.log('in changeToMiddleLayer 2 ');
this.animaNode.parent = middleLayer;
// }, 50);
}
}
dragonDisplay;
animaNode;
maxTexture;
setOneAnima(data, cb) {
console.log(' setOneAnima 1')
const middleLayer = <any>cc.find("middleLayer");
let animaNode = middleLayer?.myAnimNode;
let dragonDisplay;
if (!animaNode) {
console.log(' setOneAnima 2')
animaNode = new cc.Node();
dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
const mapMaxScale = this._mapScaleMax;
const data = this.data;
animaNode.updateScale = (oldS, newS) => {
const animaNode = new cc.Node();
this.canvas.addChild(animaNode);
console.log('in updateScale 1');
const cScale = oldS;
const mScale = newS;
animaNode.scale = cScale / mScale * mapMaxScale;
if (data.scale) {
animaNode.scale *= data.scale;
console.log('in updateScale 2');
}
}
if (middleLayer) {
console.log(' setOneAnima 3')
middleLayer.myAnimNode = animaNode;
}
} else {
console.log(' setOneAnima 4')
dragonDisplay = animaNode.getComponent(dragonBones.ArmatureDisplay);
}
animaNode.parent = this.canvas;
// const animaNode = new cc.Node();
// this.canvas.addChild(animaNode);
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
if (!data.texPngData) {
return
}
const image = data.texPngData.url//"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
const ske = data.skeJsonData.url//"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
const atlas = data.texJsonData.url//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
console.log(' setOneAnima 5')
const image = data.texPngData.url; //"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
const ske = data.skeJsonData.url; //"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
const atlas = data.texJsonData.url; //"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
// cc.assetManager.loadAny({url: ske, type: 'json'}, (error, atlasJson) => {
......@@ -559,35 +751,93 @@ export default class SceneComponent extends MyCocosSceneComponent {
// console.log('atlasJson: 1 ', atlasJson);
// })
const oldAtlas = dragonDisplay.dragonAtlasAsset;
const oldAsset = dragonDisplay.dragonAsset;
cc.assetManager.loadRemote(image, (error, texture) => {
cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
console.log(' setOneAnima 6')
// cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
cc.assetManager.loadAny({ url: atlas, reload: true }, (error, atlasJson) => {
console.log(' setOneAnima 7')
// cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
cc.assetManager.loadAny({ url: ske, reload: true }, (error, dragonBonesJson) => {
console.log(' setOneAnima 8')
if (this.jumpData == null) {
console.log(' jumpData == null ');
this.delayRelease(oldAtlas, oldAsset)
}
cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
// setTimeout(() => {
// if (oldAtlas) {
// console.log(' in aaaa 1')
// if (oldAtlas.texture) {
// console.log(' in aaaa 2')
// oldAtlas.texture.destroy();
// }
// oldAtlas.destroy();
// }
// if (oldAsset) {
// console.log(' in aaaa 3')
// oldAsset.destroy();
// }
console.log('error: 2', error);
console.log('atlasJson: 2', atlasJson);
// const assets = cc.assetManager.assets;
// console.log('~ assets: ', assets);
// }, 2000);
this.maxTexture = texture;
// this.maxTexture = texture;
// const atlas = new dragonBones.DragonBonesAtlasAsset();
// atlas.atlasJson = atlasJson;
// atlas.texture = texture;
const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = atlasJson;
atlas.atlasJson = JSON.stringify(atlasJson);
atlas.texture = texture;
console.log(' setOneAnima 9')
const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = dragonBonesJson;
asset.dragonBonesJson = JSON.stringify(dragonBonesJson);
console.log(' setOneAnima 10')
animaNode.removeComponent(dragonBones.ArmatureDisplay)
dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
console.log('dragonDisplay = ' + typeof(dragonDisplay));
dragonDisplay.dragonAtlasAsset = atlas;
console.log('汪汪汪 1')
dragonDisplay.dragonAsset = asset;
console.log('汪汪汪 2')
console.log('type: ' + typeof(asset.dragonBonesJson));
let json = JSON.parse(asset.dragonBonesJson);
console.log('json: ', json);
let armatures = json["armature"];
console.log('armatures: ', armatures);
let armatureNames = [];
for (let i = 0; i < armatures.length; i++) {
armatureNames.push(armatures[i].name);
}
// console.log('armatureNames: ', armatureNames);
console.log('armatureNames: ', armatureNames);
console.log(' setOneAnima 11')
if (armatureNames.length > 0) {
let defaultArmatureName = armatureNames[0];
dragonDisplay.armatureName = defaultArmatureName;
......@@ -602,6 +852,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
animaNode['animationNames'] = animationNames;
}
console.log(' setOneAnima 12')
animaNode.scale = this._mapScaleMax;
if (this.data.scale) {
animaNode.scale *= this.data.scale;
......@@ -609,25 +861,64 @@ export default class SceneComponent extends MyCocosSceneComponent {
// dragonDisplay.timeScale = 50;
// cb && cb();
// setTimeout(() => {
// animaNode.parent = middleLayer;
// // dragonDisplay.dragonAtlasAsset.decRef();
// // dragonDisplay.destroy();
// // dragonDisplay.dragonAsset.decRef();
// setTimeout(() => {
// callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
// }, 1000);
// }, 10000);
// return ;
dragonDisplay.playAnimation(animaNode['animationNames'][0], 1);
dragonDisplay.timeScale = 0;
dragonDisplay.on(dragonBones.EventObject.FRAME_EVENT, (e) => {
console.log(' setOneAnima 13')
const frameEventFunc = (e) => {
console.log(' in frameEventFunc ')
if (this.playTimes > 0) {
this.animChangeStep(e['name']);
}
})
dragonDisplay.on(dragonBones.EventObject.COMPLETE, (e) => {
};
dragonDisplay.off(dragonBones.EventObject.FRAME_EVENT)
dragonDisplay.on(dragonBones.EventObject.FRAME_EVENT, frameEventFunc)
console.log(' setOneAnima 14')
const compFunc = (e) => {
console.log(' in compFunc ')
if (this.isLast && this.playTimes > 0) {
this.showGoodjob();
} else {
this.animPlayEnd();
}
}
dragonDisplay.off(dragonBones.EventObject.COMPLETE)
dragonDisplay.on(dragonBones.EventObject.COMPLETE, compFunc)
// this.releaseAssets();
})
console.log(' setOneAnima 15')
const touchFunc = (e) => {
animaNode.on('touchstart', (e) => {
console.log(' in touchFunc ')
const pos = e.getLocation();
const x = pos.x// - e.currentTarget.width / 2;
......@@ -636,7 +927,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
const newPos = animaNode.convertToNodeSpaceAR(cc.v2(x, y));
console.log('X: ', Math.round( newPos.x ));
console.log('Y: ', Math.round( newPos.y ));
})
}
animaNode.off('touchstart')
animaNode.on('touchstart', touchFunc)
console.log(' setOneAnima 16')
this.dragonDisplay = dragonDisplay;
this.animaNode = animaNode;
......@@ -644,7 +940,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cb && cb();
console.log("animaNode: ", animaNode);
// console.log("animaNode: ", animaNode);
});
});
......@@ -652,6 +948,31 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
delayRelease(oldAtlas, oldAsset, delteItem=null) {
setTimeout(() => {
if (oldAtlas && oldAtlas.isValid) {
console.log(' in aaaa 1')
if (oldAtlas.texture) {
console.log(' in aaaa 2')
oldAtlas.texture.destroy();
}
oldAtlas.destroy();
}
if (oldAsset && oldAsset.isValid) {
console.log(' in aaaa 3')
oldAsset.destroy();
}
if (delteItem) {
delteItem.removeFromParent();
}
const assets = cc.assetManager.assets;
console.log('~ assets: ', assets);
}, 2000);
}
curTextObj;
checkShowText() {
if (this.audioId == null) {
......@@ -774,21 +1095,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
releaseAssets() {
this.animaNode.active = false;
this.animaNode.removeFromParent();
// console.log(' in releaseAssets 1');
const maxTexture = this.maxTexture;
const audioClip = this.audioClip;
// const maxTexture = this.maxTexture;
// const audioClip = this.audioClip;
setTimeout(() => {
if (maxTexture) {
cc.assetManager.releaseAsset(maxTexture);
}
if (audioClip) {
cc.assetManager.releaseAsset(audioClip);
}
}, 3000);
// if (cc.assetManager.cacheManager) {
// cc.assetManager.cacheManager.clearCache()
// }
}
onDestroy() {
......
{
"ver": "1.0.8",
"uuid": "0a9b6933-19b3-4285-8db4-84bb3cb6d49f",
"uuid": "4b04c1fe-389a-4f52-9bf6-5b99e20a5148",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "86ef0f2d-51a1-4a85-ae5c-745ffa64629e",
"uuid": "5bc805af-dd93-4a02-abfd-cc76b187f630",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
......@@ -86,9 +86,15 @@ export class MyCocosSceneComponent extends cc.Component {
}
preload() {
console.log(' in preload');
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
console.log('preloadArr: ', JSON.stringify(preloadArr));
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
console.log(' in preload 2');
if (window && window["air"]) {
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
......
{
"ver": "1.0.8",
"uuid": "e1d0e826-9ae5-44a7-84d7-94c658863269",
"uuid": "6e0b6676-06f6-4eec-a4d6-ee3d719e8d18",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "0a6d0a62-a030-4d6c-a688-2412dcfbd773",
"uuid": "efb7b027-5e20-4aa1-b1f0-3db0c3b7ddf7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "c33319ef-869c-489c-a3bd-15d2ecfec452",
"uuid": "cc54554d-3d49-492f-b91b-5fba456005cc",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "3b4f28dd-93b0-4c54-a408-67e0d9bae02a",
"uuid": "b4326727-a883-47d9-8e1a-f1357a709c76",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "4d4d7400-552f-455c-9c37-b7436be83618",
"uuid": "3b2d5158-3738-4a81-9c22-74ed9e4a2b5f",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.3.5",
"uuid": "dcc829d6-b8a4-4342-ba8e-108c31927e87",
"uuid": "f98c855b-ece4-462a-9920-f71a83cf9bee",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"back": {
"ver": "1.0.4",
"uuid": "da8f0dec-acf7-4074-aecf-af21edda9770",
"rawTextureUuid": "dcc829d6-b8a4-4342-ba8e-108c31927e87",
"uuid": "ef85a365-b549-4634-b77c-49c73499acaf",
"rawTextureUuid": "f98c855b-ece4-462a-9920-f71a83cf9bee",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "f96cfc53-6fe1-4d54-880d-b97f3ebb191a",
"uuid": "e35918bb-b8f4-49c9-92b2-67f6e15afea4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"black": {
"ver": "1.0.4",
"uuid": "e508ee82-6457-45d6-a336-001a08e56421",
"rawTextureUuid": "f96cfc53-6fe1-4d54-880d-b97f3ebb191a",
"uuid": "0013f3d4-495d-4da1-b04e-f31da30b47b2",
"rawTextureUuid": "e35918bb-b8f4-49c9-92b2-67f6e15afea4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "488c2160-45ce-498b-a3b4-c377c530f947",
"uuid": "3abf6a20-da34-4fa5-8ddf-a6369baefe33",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_0": {
"ver": "1.0.4",
"uuid": "c9a07b9c-1eee-4ccb-8e6d-923de0688268",
"rawTextureUuid": "488c2160-45ce-498b-a3b4-c377c530f947",
"uuid": "d98a1baa-8483-4873-bbe4-02bbfe5f6e69",
"rawTextureUuid": "3abf6a20-da34-4fa5-8ddf-a6369baefe33",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "a7f76fa1-68eb-4dc4-85b6-2b9ef49403d4",
"uuid": "0b27c7bb-3516-4e0f-ab5a-869db77f6ceb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_1": {
"ver": "1.0.4",
"uuid": "520d6f56-91fe-404d-87d6-f4fa8b9f4637",
"rawTextureUuid": "a7f76fa1-68eb-4dc4-85b6-2b9ef49403d4",
"uuid": "13b4bbd9-22d2-46fb-8b2e-c55b4443956d",
"rawTextureUuid": "0b27c7bb-3516-4e0f-ab5a-869db77f6ceb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "7d73e3b4-1ba2-44c6-a0cc-52921477832d",
"uuid": "9fc4d58d-cdee-4cbb-b583-db57d4142c68",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_2": {
"ver": "1.0.4",
"uuid": "5676975d-02a5-4e6d-9ac4-f2a5a8aee8a9",
"rawTextureUuid": "7d73e3b4-1ba2-44c6-a0cc-52921477832d",
"uuid": "931ef3ef-9945-4451-8002-828ec2df017f",
"rawTextureUuid": "9fc4d58d-cdee-4cbb-b583-db57d4142c68",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "dcf60be7-0833-4b01-aae2-bf801cfebbe2",
"uuid": "e91115d3-b87c-4d6d-bfea-a38345fe3211",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_3": {
"ver": "1.0.4",
"uuid": "f3b11cb3-ca2f-4159-94b9-f9e9d84509ca",
"rawTextureUuid": "dcf60be7-0833-4b01-aae2-bf801cfebbe2",
"uuid": "6af3a593-2795-42a4-b4b6-2efcef71e07b",
"rawTextureUuid": "e91115d3-b87c-4d6d-bfea-a38345fe3211",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "af013b40-08c2-4ac5-871e-5655685bcac8",
"uuid": "2d982111-5fb1-484d-9630-f37723e5f896",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"light": {
"ver": "1.0.4",
"uuid": "1cdc48e6-d317-4d28-9d8e-3a939c787046",
"rawTextureUuid": "af013b40-08c2-4ac5-871e-5655685bcac8",
"uuid": "0058ee41-02be-4173-bd18-94182d12a46c",
"rawTextureUuid": "2d982111-5fb1-484d-9630-f37723e5f896",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "b39e0844-d087-4294-9986-47746048b2c6",
"uuid": "a568743c-5b57-4df5-9170-2f2b517f1708",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"start_title": {
"ver": "1.0.4",
"uuid": "0bbe544e-bb4f-49e4-8b15-30d1465bcfb3",
"rawTextureUuid": "b39e0844-d087-4294-9986-47746048b2c6",
"uuid": "f6b4b111-644c-45af-8a90-9947af521c96",
"rawTextureUuid": "a568743c-5b57-4df5-9170-2f2b517f1708",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "543f75c9-48ab-4029-90ab-47d502dc703b",
"startScene": "9ff21de2-ae3e-4903-b997-099e269bc7ef",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
......
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