Commit fd39dca4 authored by yu's avatar yu

5.19

parent 288dc6ac
{
"ver": "1.1.2",
"uuid": "728dfcaf-8d62-48e4-af31-5a758675657b",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "e202cd26-47f8-4177-94c6-a836988ccff8",
"downloadMode": 0,
"duration": 2.220408,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "13563031-3f87-4b7e-bbce-f6aee0b23316",
"downloadMode": 0,
"duration": 3.239184,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f6623395-178f-4412-92cb-70eb12b11777",
"downloadMode": 0,
"duration": 0.914286,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "c2b52460-0f8f-4fff-8bf3-3a76cfc42e10",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "6803f51f-9cdb-4610-bf64-0e423061bfd1",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "b60e570d-c8fa-4619-9802-0420c42e88d2",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "4a74f020-e753-4d8e-80bd-241347ac5fdf",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "mouse_end",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 5
},
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": {
"__id__": 12
},
"_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,
0.11,
0.11,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "ske_candy",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1668,
"height": 938
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-432.512,
0,
0,
0,
0,
1,
8,
8,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 1,
"premultipliedAlpha": false,
"_armatureKey": "e6ec02b6-ebbf-4d17-acaf-4945d7fb877f#5788586f-1aff-4185-b6cc-808408c509f4",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "e6ec02b6-ebbf-4d17-acaf-4945d7fb877f"
},
"_N$dragonAtlasAsset": {
"__uuid__": "5788586f-1aff-4185-b6cc-808408c509f4"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "baf374f1-c8c5-4e57-a484-1fd6b41fb37b"
},
"fileId": "fcHw9SaDpAK7zwmxUDrLPs",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "ske",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1508,
"height": 2331.53
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-2095.446,
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": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 1,
"premultipliedAlpha": false,
"_armatureKey": "a80e649d-a03b-4765-982c-56931d635a44#30147f0f-a97b-4f52-9f51-33aa613ada59",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "a80e649d-a03b-4765-982c-56931d635a44"
},
"_N$dragonAtlasAsset": {
"__uuid__": "30147f0f-a97b-4f52-9f51-33aa613ada59"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "baf374f1-c8c5-4e57-a484-1fd6b41fb37b"
},
"fileId": "5c1hp2rfRESZM5fPSRCCMq",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "block",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": {
"__id__": 10
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100000,
"height": 100000
},
"_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": ""
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "baf374f1-c8c5-4e57-a484-1fd6b41fb37b"
},
"fileId": "c6mVnUkE5JaYueomXGzBNp",
"sync": false
},
{
"__type__": "0e6618sCSxBeYB00pouLhfn",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"startPosition": {
"__type__": "cc.Vec2",
"x": 0,
"y": -2095.446
},
"voice": {
"__uuid__": "3fa7aab4-b81d-40e6-9691-73935a1d92da"
},
"voice2": {
"__uuid__": "b3d3e0e6-a546-402f-9f78-36dca911638b"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "baf374f1-c8c5-4e57-a484-1fd6b41fb37b"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "baf374f1-c8c5-4e57-a484-1fd6b41fb37b",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
startPosition: cc.Vec2,
voice: cc.AudioClip,
voice2: cc.AudioClip,
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.ske = this.node.getChildByName("ske");
this.ske.x = this.startPosition.x;
this.ske.y = this.startPosition.y;
// //动画播放测试
// let db = this.ske.getComponent(dragonBones.ArmatureDisplay)
// db.playAnimation('normal');
// console.log(db.timeScale);
// setTimeout(() => {
// db.timeScale = 0.0001;
// console.log(db.timeScale);
// }, 1000);
// setTimeout(() => {
// db.timeScale = 1;
// console.log(db.timeScale);
// }, 2000);
},
play() {
return new Promise((resolve, reject) => {
this.node.active = true;
cc.audioEngine.playEffect(this.voice, false);
setTimeout(() => {
cc.audioEngine.playEffect(this.voice2, false);
}, 500);
let db = this.ske.getComponent(dragonBones.ArmatureDisplay)
db.playAnimation('normal', 1);
db.addEventListener("loopComplete", () => {
// resolve('');
})
setTimeout(() => {
resolve('');
}, 2000);
});
}
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "02a7843c-58b0-4759-b399-bbfdd7d16f82",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "particle_star",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 5
},
"_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": [
-1434.597,
348.594,
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": ""
},
{
"__type__": "cc.Node",
"_name": "particle_star",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_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": ""
},
{
"__type__": "cc.ParticleSystem",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 768,
"_dstBlendFactor": 1,
"_custom": true,
"_file": {
"__uuid__": "a1f705a9-e753-4699-8894-4363b038f2da"
},
"_spriteFrame": {
"__uuid__": "247bd8f7-6c0e-46a1-afda-c5eb7e9cc284"
},
"_texture": null,
"_stopped": true,
"playOnLoad": true,
"autoRemoveOnFinish": false,
"totalParticles": 191,
"duration": 0.22,
"emissionRate": 406.3829787234043,
"life": 0.3,
"lifeVar": 0,
"_startColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 226
},
"_startColorVar": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 0
},
"_endColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_endColorVar": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 0
},
"angle": 17,
"angleVar": 180,
"startSize": 10,
"startSizeVar": 20,
"endSize": -1,
"endSizeVar": 0,
"startSpin": 0,
"startSpinVar": 0,
"endSpin": 0,
"endSpinVar": 0,
"sourcePos": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"posVar": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_positionType": 1,
"positionType": 1,
"emitterMode": 0,
"gravity": {
"__type__": "cc.Vec2",
"x": -20,
"y": 420
},
"speed": 450,
"speedVar": 20,
"tangentialAccel": -700,
"tangentialAccelVar": 0,
"radialAccel": 0,
"radialAccelVar": 0,
"rotationIsDir": false,
"startRadius": 0,
"startRadiusVar": 0,
"endRadius": 0,
"endRadiusVar": 0,
"rotatePerS": 0,
"rotatePerSVar": 0,
"_N$preview": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fcv3QB7CFM+q6n1fsvkn0z",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "dcc40969-6fea-4a66-b474-d99ffa1ca5ef",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d2acaf9f-5b7d-4866-a723-7e5cea912f5a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "layout_mouse",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 13
}
],
"_prefab": {
"__id__": 14
},
"_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": 1,
"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": ""
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 6
},
{
"__id__": 9
}
],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 12
},
"_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": ""
},
{
"__type__": "cc.Node",
"_name": "star_bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "54beeaf0-8640-4d6d-bdb2-40be6c49f378"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "1a6bNni9hAzZuAOicd4es+",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
}
],
"_prefab": {
"__id__": 8
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "047bdd7d-6c4f-47dc-944a-12cf7a461f93"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "0dcJdIc9BNfbQiPTRx9GVW",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "icon_bigstar",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
}
],
"_prefab": {
"__id__": 11
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "047bdd7d-6c4f-47dc-944a-12cf7a461f93"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "e8QBmuw8VOBYptnR5JD386",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "9eIg5jomZOV5E+Yzh+2uPU",
"sync": false
},
{
"__type__": "aa1f1smbntECpwesqp/Tg0F",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "564dd930-80a8-4d89-bf96-f0f5be1e92cb",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
// import Game from "../../scene/Game";
import pg from "../../scene/pg";
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
onLoad() {
pg.event.on("mouse_add", () => {
this.showBigStar();
})
pg.event.on("mouse_num", (max: number) => {
this.initStar(max);
})
}
init(max) {
}
reviceMouse() {
}
start() {
}
//-----------------------STAR-----------------------------
bigStarArr: cc.Node[];
canvas: cc.Node;
curGroupIndex: number
@property(cc.Vec2)
position: cc.Vec2;
@property(cc.AudioClip)
bigStarClip: cc.AudioClip;
@property(cc.AudioClip)
starCountClip: cc.AudioClip;
//搭配res中的star_bg star等使用
initStar(max) {
this.curGroupIndex = 0;
this.canvas = cc.find('Canvas');
const gArr = [];
gArr.length = max;
if (gArr.length < 1) {
return;
}
this.cleanStar();
this.bigStarArr = [];
let baseX = this.position.x;
let baseY = this.position.y;
let disW = 80;// * this._mapScaleMin
// let disH = 80 * this._mapScaleMin;
let disScale = 1;
if (gArr.length > 5) {
// disH = (400 / gArr.length) * this._mapScaleMin;
disScale = 5 / gArr.length;
}
for (let i = 0; i < gArr.length; i++) {
const starBg = this.getSprNode('star_bg');
this.canvas.addChild(starBg, 10);
// starBg.x = baseX;
// starBg.y = baseY - i * disH;
starBg.x = baseX - i * disW;
starBg.y = baseY
starBg.scale = disScale;
const starTop = this.getSprNode('star');
starBg.addChild(starTop);
starTop.active = false;
starBg.star = starTop;
const starBig = this.getSprNode('icon_bigstar');
starTop.addChild(starBig);
starBig.angle = -90;
starBg.starBig = starBig;
this.bigStarArr.push(starBg);
}
console.log("bigStarArr: ", this.bigStarArr);
}
cleanStar() {
if (this.bigStarArr && this.bigStarArr.length > 0) {
for (let i = 0; i < this.bigStarArr.length; i++) {
this.bigStarArr[i].removeFromParent();
}
}
}
showBigStar() {
if (!this.bigStarArr || this.bigStarArr.length <= 0) {
// this.checkGameEnd();
return;
}
const bigStarBg = this.bigStarArr[this.curGroupIndex++];
if (!bigStarBg) return;
const starBig = bigStarBg.starBig;
starBig.scale = 1;
const star = bigStarBg.star;
star.active = true;
star.scaleX = 0.7 / bigStarBg.scale;
star.scaleY = 1 / bigStarBg.scale;
star.angle = 90;
const canvas = cc.find('Canvas');
const startPos = this.exchangeNodePos(star.parent, canvas);
const middlePos = this.exchangeNodePos(star.parent, canvas);
star.x = startPos.x;
star.y = startPos.y - starBig.height;
console.log('middlePos = ' + JSON.stringify(middlePos));
const time = 1;
cc.tween(star)
.to(0.3, { y: middlePos.y + 80 }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y + 40, scaleX: 1.2 / bigStarBg.scale, scaleY: 0.8 / bigStarBg.scale }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y, scaleX: 1 / bigStarBg.scale, scaleY: 1 / bigStarBg.scale }, { easing: 'quadOut' })
.delay(0.1)
.to(0.8, { angle: -720, scale: 1 })
.start();
cc.tween(star)
.delay(0.6)
.to(0.8, { x: 0 }, { easing: 'quadIn' })
.start();
cc.tween(star)
.delay(0.6)
.to(0.8, { y: 0 }, { easing: 'quadOut' })
.start();
cc.tween(starBig)
.delay(0.6)
.to(0.8, { scale: 0 }, { easing: 'quadOut' })
.call(() => {
pg.event.emit("mouse_num_game_end")
// this.playAudio(this.starCountClip);
})
.start();
this.playAudio(this.bigStarClip);
}
//-----------------------STAR-----------------------------
getSprNode(resName) {
const sf = pg.view.find(this, `img/${resName}`).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
exchangeNodePos(baseNode, targetNode) {
return baseNode.convertToNodeSpaceAR(targetNode._parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)));
}
playAudio(audioClip, cb = null) {
if (audioClip) {
const audioId = cc.audioEngine.playEffect(audioClip, false);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
}
}
// update (dt) {}
}
{
"ver": "1.0.8",
"uuid": "d26058a5-a4fd-4f65-b257-8769ff62f549",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "7ccfad51-5bbc-4c49-a5d2-93f15e2cd2b2",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "57753175-db68-4aab-a973-8abce1f1664a",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import Game from "../../scene/Game";
import pg from "../../scene/pg";
const { ccclass, property } = cc._decorator;
@ccclass
export default class MouseStart extends cc.Component {
@property(cc.Vec2)
startPosition: cc.Vec2 = cc.v2(0, 0)
@property(cc.Vec2)
targetPosition: cc.Vec2 = cc.v2(0, 0)
@property(cc.Float)
moveInTime: number = 1;
private ske: cc.Node;
private block: cc.Node;
private shadow: cc.Node;
onLoad() {
//修改ske的信息
this.ske = this.node.getChildByName("ske");
this.block = this.node.getChildByName("block");
this.shadow = this.node.getChildByName("shadow");
this.ske.x = this.startPosition.x;
this.ske.y = this.startPosition.y;
pg.event.on("mouse_start_play", (data) => {
this.play(data).then(() => {
pg.event.emit("mouse_start_play_success");
})
})
}
play({ voice, time }: any) {
this.node.active = true;
this.block.active = true;
this.ske.active = true;
this.ske.x = this.startPosition.x;
this.ske.y = this.startPosition.y;
this.moveInTime = time || 5;
return new Promise((resolve, reject) => {
let isPlaying = true;
let load = false;
pg.load.loadDB(this.ske, { ske: Game.getIns().aniEnter.skeJsonData.url, tex: Game.getIns().aniEnter.texJsonData.url, png: Game.getIns().aniEnter.texPngData.url }).then((animationName) => {
if (load) return;
load = true;
cc.Tween.stopAllByTarget(this.ske);
this.playLocalAudio('enter').then(() => {
this.playAudioByUrl(voice)
})
cc.tween(this.ske).to(0.5, { x: this.targetPosition.x, y: this.targetPosition.y }).delay(0.9).call(() => {
let db = this.ske.getComponent(dragonBones.ArmatureDisplay);
db.playAnimation('normal', 0);
}).delay(this.moveInTime).call(() => {
this.playLocalAudio('leave')
cc.tween(this.ske).by(0.1, { y: 200 }).by(1, { y: -10000 }).call(() => {
this.ske.active = false;
this.node.active = false;
this.block.active = false;
resolve('');
}).start();
}).start();
})
});
// this.moveInTime = Game.getIns().aniEnter.time || 5;
// return new Promise((resolve, reject) => {
// let isPlaying = true;
// this.ske.x = this.startPosition.x;
// this.ske.y = this.startPosition.y;
// this.ske.active = true;
// this.node.active = true;
// this.block.active = true;
// pg.load.loadDB(this.ske, { ske: Game.getIns().aniEnter.skeJsonData.url, tex: Game.getIns().aniEnter.texJsonData.url, png: Game.getIns().aniEnter.texPngData.url }).then((animationName) => {
// cc.tween(this.ske).to(1.3, { x: this.targetPosition.x, y: this.targetPosition.y }).call(() => {
// audioUrl = audioUrl ? audioUrl : Game.getIns().aniEnter.audioUrl;
// if (audioUrl) {
// pg.audio.playAudioByUrl(audioUrl).then(() => {
// isPlaying = false;
// resolve('');
// })
// }
// let db = this.ske.getComponent(dragonBones.ArmatureDisplay);
// db.playAnimation('normal', 1111111);
// db.addEventListener("loopComplete", () => {
// if (!isPlaying) {
// this.block.active = false;
// resolve('');
// }
// })
// }).delay(this.moveInTime).call(() => {
// this.ske.active = false;
// this.node.active = false;
// this.block.active = false;
// }).start();
// })
// });
}
playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
});
} else {
cb && cb();
}
}
playLocalAudio(audioName) {
const audio = this.node.getChildByName("audio").getChildByName(audioName).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
{
"ver": "1.0.8",
"uuid": "fc99ea85-70f8-442b-a5b9-9a5497ab61d0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
class Item {
type;
txt;
picUrl;
audioUrl;
public page;
constructor({ type, txt, pic_url, audio_url }, page) {
this.type = type;
this.txt = txt;
this.picUrl = pic_url;
this.audioUrl = audio_url;
this.page = page;
}
}
export default class Game {
private static ins: Game;
public static getIns(): Game {
if (!Game.ins) Game.ins = new Game();
return Game.ins;
}
private data: any;
private lists: Array<Item>
constructor() {
//
this.start = false;
this.lists = [];
}
get len() {
return this.lists.length;
}
public aniEnter: any;
public init(data) {
this.start = false;
this.lists = [];
this.data = data;
this.aniEnter = data.aniEnter;
}
public start: boolean;
reset() {
this.start = true;
this.lists = [];
for (let i = 0; i < this.data.length; i++) {
let data = this.data[i];
this.lists.push(new Item(data, i + 1));
}
}
getDataByPage(page) {
return this.lists.filter(li => li.page == page)[0]
}
get isOver() {
let times = 0;
// this.lists.forEach((li) => {
// times += li.stem.times;
// })
return times == 0;
}
}
let win: any = window;
win.Game = Game;
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "b4a95106-bf79-498e-91a3-715fb9cc3ec8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Game from "./Game";
import pg from "./pg";
import OptionItem from "./OptionItem";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
public item: cc.Node;
private roundIdx = 0;
private btn_laba: cc.Node;
private layout: cc.Node;
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
pg.event.emit("mouse_start_play", { voice: Game.getIns().aniEnter.audioUrl, time: Game.getIns().aniEnter.time });
}
_cantouch = null;
initData() {
Game.getIns().init(this.data);
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
pg.event.emit("mouse_num", this.data.item.groupArr.length);
this.layout = cc.find("layout", this.node);
this.initBtn();
this.showGame();
}
initListener() {
pg.event.on("mrbr05_click_right", () => {
this.roundIdx++;
pg.event.emit("mouse_add", () => { });
this.showGame();
})
pg.event.on("mouse_start_play_success", () => {
this.playLaba();
})
this.btn_laba = cc.find("btn_laba", this.node);
this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this);
}
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
}
initBtn() {
}
// update (dt) {},
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
private gameOver() {
setTimeout(() => {
let mouse_end = pg.view.find(this, "mouse_end");
mouse_end.active = true;
mouse_end.getComponent("mrbr05_mouse_end").play().then(() => {
onHomeworkFinish();
})
}, 1800);
}
private updateRound() {
let round = cc.find("top/label", this.node);
let rIdx = this.roundIdx;
if (rIdx > this.data.item.groupArr.length) rIdx = this.data.item.groupArr.length;
round.getComponent(cc.Label).string = (rIdx + 1) + "/" + this.data.item.groupArr.length;
}
/**
* 2: y;600 x:280 -280
* 3: y:600 x:380 0 -380
* 4: y:610 400 x: -380 120 -120 380
*
*/
private getItemPos(num) {
let pos1 = [cc.v2(-280, 600), cc.v2(280, 600)];
let pos2 = [cc.v2(-380, 550), cc.v2(-0, 550), cc.v2(380, 550)];
let pos3 = [cc.v2(-380, 610), cc.v2(-120, 400), cc.v2(120, 610), cc.v2(380, 400)];
if (num == 2) return pos1;
else if (num == 3) return pos2;
else if (num == 4) return pos3;
}
private showGame() {
if (this.roundIdx >= this.data.item.groupArr.length) {
this.gameOver();
return;
}
this.updateRound();
this.showProp();
}
private showProp() {
this.layout.removeAllChildren();
let data = this.data.item.groupArr[this.roundIdx].questionArr[0];
cc.assetManager.loadRemote(data.audio_url, async (err, audioClip) => {
this.btn_laba.audioClip = audioClip;
if (this.roundIdx > 0) this.playLaba();
});
let pos = this.getItemPos(data.answerArr.length);
let sc = [1, 0.88, 0.85]
for (let i = 0; i < data.answerArr.length; i++) {
let dt = data.answerArr[i];
let item = cc.instantiate(this.item);
item.getComponent(OptionItem).initItem(dt, data.answerType);
this.layout.addChild(item);
this.itemShow(item, pos[i]);
item.scale = sc[data.answerArr.length - 2];
}
}
private itemShow(item, pos) {
item.x = pos.x;
cc.tween(item)
.to(1, { position: cc.v2(pos.x, pos.y) })
.start();
}
private async playLaba() {
if (!this.btn_laba.audioClip) return;
let img_1 = this.btn_laba.getChildByName("img_1");
let img_2 = this.btn_laba.getChildByName("img_2");
let img_3 = this.btn_laba.getChildByName("img_3");
cc.Tween.stopAllByTarget(img_1);
cc.Tween.stopAllByTarget(img_2);
cc.Tween.stopAllByTarget(img_3);
img_1.opacity = 255;
img_2.opacity = 255;
img_3.opacity = 255;
pg.audio.playAudio(this.btn_laba.audioClip, () => {
cc.Tween.stopAllByTarget(img_1);
cc.Tween.stopAllByTarget(img_2);
cc.Tween.stopAllByTarget(img_3);
img_1.scale = 0.6;
img_1.opacity = 0;
img_2.scale = 0.6;
img_2.opacity = 0;
img_3.scale = 0.6;
img_3.opacity = 0;
});
cc.tween(img_1).repeatForever(cc.tween().to(1, { scale: 1, opacity: 0 }).to(0, { scale: 0.6, opacity: 255 })).start();
await this.awaitTime(333)
cc.tween(img_2).repeatForever(cc.tween().to(1, { scale: 1, opacity: 0 }).to(0, { scale: 0.6, opacity: 255 })).start();
await this.awaitTime(333)
cc.tween(img_3).repeatForever(cc.tween().to(1, { scale: 1, opacity: 0 }).to(0, { scale: 0.6, opacity: 255 })).start();
}
private async awaitTime(t) {
let time = t;
return new Promise(function (resolve, reject) {
setTimeout(() => {
resolve("");
return true;
}, time);
})
}
}
import pg from "./pg";
// @const
const { ccclass, property } = cc._decorator;
/**
*
*/
@ccclass
export default class OptionItem extends cc.Component {
@property(cc.Node)
public ani_flower: cc.Node;
@property(cc.AudioClip)
public errorClip: cc.AudioClip;
@property(cc.AudioClip)
public rightClip: cc.AudioClip;
@property(cc.AudioClip)
public flyClip: cc.AudioClip;
private speed = 1.5;
private updateView = false;
private isClick = false;
/**
* onLoad
*/
onLoad(): void {
}
protected update(dt: number): void {
}
public initItem(data, type) {
let checkmark = this.node.getChildByName("checkmark");
if (type == "text") this.initTextItem(data);
else if (type == "pic") this.initPicItem(data);
else if (type == "picText") this.initPicTextItem(data);
this.node.on(cc.Node.EventType.TOUCH_END, () => {
if (this.isClick) return;
if (data.answerRight == 0) {
this.itemError(this.node);
return;
}
this.isClick = true;
cc.audioEngine.playEffect(this.rightClip, false);
checkmark.active = true;
this.itemAction();
})
}
public initTextItem(data) {
let g_label = this.node.getChildByName("g_label");
g_label.active = true;
g_label.getComponent(cc.Label).string = data.text;
}
public initPicItem(data) {
let g_img = this.node.getChildByName("g_img");
g_img.active = true;
let head = g_img.getChildByName("head");
pg.view.setNetImg(head, data.pic_url, { w: 245, h: 160 });
}
public initPicTextItem(data) {
let g_imgText = this.node.getChildByName("g_imgText");
g_imgText.active = true;
let head = g_imgText.getChildByName("head");
let Label = g_imgText.getChildByName("Label");
pg.view.setNetImg(head, data.pic_url, { w: 245, h: 160 });
Label.getComponent(cc.Label).string = data.text;
}
private itemError(item) {
cc.audioEngine.playEffect(this.errorClip, false);
let funTw = cc.tween;
funTw(item)
.by(0.01, { angle: 5 })
.to(0.01, { angle: 0 })
.by(0.01, { angle: -5 })
.to(0.01, { angle: 0 })
.by(0.01, { angle: 5 })
.to(0.01, { angle: 0 })
.by(0.01, { angle: -5 })
.to(0.01, { angle: 0 })
.by(0.01, { angle: 5 })
.to(0.01, { angle: 0 })
.by(0.01, { angle: -5 })
.to(0.01, { angle: 0 })
.start();
}
private showAniFlower(target) {
// let pos = target.convertToWorldSpaceAR(cc.Vec2.ZERO);
// let pos2 = this.node.convertToNodeSpaceAR(pos);
// let ani_flower = cc.instantiate(this.ani_flower);
// target.addChild(ani_flower);
// ani_flower.x = 0;//pos2.x;
// ani_flower.y = 0;//pos2.y;
// ani_flower.active = true;
// cc.audioEngine.playEffect(this.rightClip, false);
// pg.audio.playAudio(this.rightClip, () => {
// // if (this.data.isCheck) this.node.runAction(cc.fadeOut(0.5));
// })
// setTimeout(() => {
// ani_flower && (ani_flower.parent = null);
// }, 3000);
}
private itemAction() {
setTimeout(() => {
cc.audioEngine.playEffect(this.flyClip, false);
}, 2000);
cc.tween(this.node)
.delay(2)
.to(1, { y: 1550 })
.call(() => {
pg.event.emit("mrbr05_click_right");
})
.start();
// this.node.runAction(cc.fadeOut(1.5));
}
}
{
"ver": "1.0.8",
"uuid": "9e5a4e49-04c4-459d-938f-9fef414850fc",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "2796339f-47d7-425f-b783-1f215616d0d8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
class CalculativeResize {
static resizeInfo() {
//0.设计尺寸
let baseSize = cc.size(2280, 1242);
//1.获取屏幕尺寸
let canvasSize = cc.view.getCanvasSize();
//2.将屏幕宽高 以高度对齐的方式 换算出场景 宽度
let sumSizeW = cc.size(canvasSize.width * baseSize.height / canvasSize.height, baseSize.height)
//3.计算场景宽度与设计宽度比率
let scaleX = sumSizeW.width / baseSize.width;
//高屏幕适配
if (scaleX <= 1) {
let sumSizeY = cc.size(baseSize.width, canvasSize.height * (baseSize.width / canvasSize.width))
let scaleY = sumSizeY.height / baseSize.height;
let posY = sumSizeY.height - baseSize.height;
return {
scaleX: 1,
posX: 0,
moveX: 0,
scaleY: scaleY,
posY: posY,
moveY: - posY / 2
}
} else {
let posX = sumSizeW.width - baseSize.width;
//需要拓展的宽度缩放比
return {
scaleX: scaleX,
posX: posX,
moveX: - posX / 2,
scaleY: 1,
posY: 0,
moveY: 0
};
}
}
}
//关于齐刘海的适配方案。
//1.需要获取对应的手机型号
//2.需要写上安全间距标记(主要是中间部分)
//3.不同的手机安全间距可能不同。(主要适配iPhone X)
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property
r_width = 1;
@property
r_height = 1;
@property
r_top = 0
@property
r_bottom = 0
@property
p_left = 0
@property
p_right = 0
@property
p_top = 0
@property
p_bottom = 0
@property
black = 0
@property
noHead = 0
@property
debug = 0
@property
hideHeight = 0
@property
hideWidth = 0
private resizeScaleX;
private resizeScaleY;
private posX;
private posY;
private nodeWidth;
private nodeHeight;
private nodeX;
private nodeY;
// LIFE-CYCLE CALLBACKS:
onLoad() {
let { scaleX, posX, scaleY, posY } = CalculativeResize.resizeInfo();
this.resizeScaleX = scaleX;
this.resizeScaleY = scaleY;
this.posX = posX;
this.posY = posY;
let { width, height, x, y } = this.node;
this.nodeWidth = width;
this.nodeHeight = height;
this.nodeX = x;
this.nodeY = y;
//增加一个resize的监听,当屏幕出现宽高比变化的时候,进行一次重新适配。
//主要用于刘海屏的重置,以及动态屏幕变化的控制(虚拟按键屏)。
}
start() {
this.resize();
}
update(dt) {
}
onDestroy() {
// if (this.black1)
// pg.view.removChildren(this.black1);
// if (this.black2)
// pg.view.removChildren(this.black2);
// this.black1 = null;
// this.black2 = null;
}
resize() {
if (!this.resizeScaleX && !this.nodeWidth) {
console.warn("手动调用此方法时,不能再onLoad中使用");
return;
}
this.resizeHeight();
this.resizeWidth();
}
//高屏幕适配
resizeHeight() {
if (this.resizeScaleY <= 1) return;
let scaleY = this.resizeScaleY;
let posY = this.posY;
let nodeWidth = this.nodeWidth;
let nodeHeight = this.nodeHeight;
let nodeX = this.nodeX;
let nodeY = this.nodeY;
if (this.debug == 1) {
console.log("断点调试点");
}
if (this.hideHeight) {
this.node.active = false;
}
//宽度拉伸
if (this.r_width == 1) {
this.node.width = nodeWidth * scaleY * 1.1;
}
//高度拉升
if (this.r_height == 1) {
this.node.height = nodeHeight * scaleY * 1.1;
}
//动态上移
if (this.p_top == 1) {
this.node.y = nodeY + posY / 2
}
//动态下移
if (this.p_bottom == 1) {
this.node.y = nodeY - posY / 2
}
}
//长屏幕适配
resizeWidth() {
if (this.resizeScaleX <= 1) return;
let resizeScaleX = this.resizeScaleX;
let posX = this.posX;
let nodeWidth = this.nodeWidth;
let nodeHeight = this.nodeHeight;
let nodeX = this.nodeX;
let nodeY = this.nodeY;
if (this.debug == 1) {
console.log("断点调试点");
}
if (this.hideWidth) {
this.node.active = false;
}
//宽度拉伸
if (this.r_width == 1) {
this.node.width = nodeWidth * resizeScaleX * 1.1;
}
//高度拉升
if (this.r_height == 1) {
this.node.height = nodeHeight * resizeScaleX * 1.1;
//高度拉伸后,图片顶部齐边【坐标下移】 y坐标下移
if (this.r_top == 1) {
this.node.y = nodeY - nodeHeight * (resizeScaleX - 1) / 2;
}
//高度拉伸后,图片底部齐边【坐标上移】 y坐标上移
if (this.r_bottom == 1) {
this.node.y = nodeY + nodeHeight * (resizeScaleX - 1) / 2;
}
}
//如果是刘海屏,减去对应的刘海屏的宽度
let lhpSize = { top: 0, bottom: 0 };
if (!this.noHead && posX != 0) lhpSize = { top: 44 * 1.5, bottom: 34 * 1.5 };
//动态左移
if (this.p_left == 1) {
this.node.x = nodeX - posX / 2 + lhpSize.top;
}
//动态右移
if (this.p_right == 1) {
this.node.x = nodeX + posX / 2 - lhpSize.bottom;
}
}
//屏幕适配--end
createBalck() {
let black = cc.instantiate(cc.find('Canvas/blackBg'));
return black;
}
setBlackActive(val) {
// if (this.black1)
// this.black1.active = val;
// if (this.black2)
// this.black2.active = val;
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "02dd27ae-b1d9-4d6d-b9f0-64f5b9ae2eca",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
export const defaultData = {
"aniEnter": {
"skeJsonData": {},
"texJsonData": {},
"texPngData": {},
"audioUrl": "http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3",
"time": 1
},
"item": {
"groupArr": [{
"questionArr": [{
"questionType": "text",
"answerType": "text",
"answerArr": [{
"text": "54333",
"pic_url": "",
"answerRight": "1"
}, {
"text": "hello",
"pic_url": "",
"answerRight": "0"
}
],
"audio_url": "http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3"
}
]
}, {
"questionArr": [{
"questionType": "text",
"answerType": "pic",
"answerArr": [{
"text": "",
"pic_url": "http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png",
"answerRight": "0"
}, {
"text": "",
"pic_url": "http://staging-teach.cdn.ireadabc.com/a5d393ae3c9759211c441f8d3fc69e04.png",
"answerRight": "1"
}, {
"text": "",
"pic_url": "http://staging-teach.cdn.ireadabc.com/4286c34a3b69bf7baea3847ec04b05b7.png",
"answerRight": "0"
}
],
"audio_url": "http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3"
}
]
}, {
"questionArr": [{
"questionType": "text",
"answerType": "picText",
"answerArr": [{
"text": "123",
"pic_url": "http://staging-teach.cdn.ireadabc.com/7780195055731416480edbc97072fe5b.png",
"answerRight": "0"
}, {
"text": "5435",
"pic_url": "http://staging-teach.cdn.ireadabc.com/4286c34a3b69bf7baea3847ec04b05b7.png",
"answerRight": "0"
}, {
"text": "688",
"pic_url": "http://staging-teach.cdn.ireadabc.com/2eb2c2a688d66ac6aa9cb6aaa81a0859.png",
"answerRight": "1"
}, {
"text": "规范广告",
"pic_url": "http://staging-teach.cdn.ireadabc.com/4dc62cd150d6cbb06febbb22bc5f6f37.png",
"answerRight": "0"
}
]
}
]
}, {
"questionArr": [{
"questionType": "text",
"answerType": "text",
"answerArr": [{
"text": "还有",
"pic_url": "",
"answerRight": "0"
}, {
"text": "救济金",
"pic_url": "",
"answerRight": "0"
}, {
"text": "好好搞",
"pic_url": "",
"answerRight": "0"
}, {
"text": "卡酷一他救济金",
"pic_url": "",
"answerRight": "1"
}
]
}
]
}
]
}
}
{
"ver": "1.1.2",
"uuid": "df6f19ee-46f0-40de-ae12-8af7e4aec67d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "5c7865f8-7e49-41ae-86e5-5d6a2ac61c2b",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>angle</key>
<real>17</real>
<key>angleVariance</key>
<real>180</real>
<key>blendFuncDestination</key>
<integer>1</integer>
<key>blendFuncSource</key>
<integer>768</integer>
<key>duration</key>
<real>0.22</real>
<key>emitterType</key>
<real>0</real>
<key>finishColorAlpha</key>
<real>1</real>
<key>finishColorBlue</key>
<real>0</real>
<key>finishColorGreen</key>
<real>0</real>
<key>finishColorRed</key>
<real>0</real>
<key>finishColorVarianceAlpha</key>
<real>0</real>
<key>finishColorVarianceBlue</key>
<real>0</real>
<key>finishColorVarianceGreen</key>
<real>0</real>
<key>finishColorVarianceRed</key>
<real>0</real>
<key>finishParticleSize</key>
<real>-1</real>
<key>finishParticleSizeVariance</key>
<real>0</real>
<key>gravityx</key>
<real>-20</real>
<key>gravityy</key>
<real>420</real>
<key>maxParticles</key>
<real>191</real>
<key>maxRadius</key>
<real>0</real>
<key>maxRadiusVariance</key>
<real>0</real>
<key>minRadius</key>
<real>0</real>
<key>particleLifespan</key>
<real>0.47</real>
<key>particleLifespanVariance</key>
<real>0</real>
<key>radialAccelVariance</key>
<real>0</real>
<key>radialAcceleration</key>
<real>0</real>
<key>rotatePerSecond</key>
<real>0</real>
<key>rotatePerSecondVariance</key>
<real>0</real>
<key>rotationEnd</key>
<real>0</real>
<key>rotationEndVariance</key>
<real>0.0</real>
<key>rotationStart</key>
<real>0</real>
<key>rotationStartVariance</key>
<real>0</real>
<key>sourcePositionVariancex</key>
<real>0</real>
<key>sourcePositionVariancey</key>
<real>0</real>
<key>sourcePositionx</key>
<real>416</real>
<key>sourcePositiony</key>
<real>774</real>
<key>speed</key>
<real>480</real>
<key>speedVariance</key>
<real>20</real>
<key>startColorAlpha</key>
<real>0.89</real>
<key>startColorBlue</key>
<real>0.2</real>
<key>startColorGreen</key>
<real>0.4</real>
<key>startColorRed</key>
<real>1</real>
<key>startColorVarianceAlpha</key>
<real>0</real>
<key>startColorVarianceBlue</key>
<real>0</real>
<key>startColorVarianceGreen</key>
<real>0</real>
<key>startColorVarianceRed</key>
<real>0</real>
<key>startParticleSize</key>
<real>20</real>
<key>startParticleSizeVariance</key>
<real>41</real>
<key>tangentialAccelVariance</key>
<real>0</real>
<key>tangentialAcceleration</key>
<real>-700</real>
<key>textureFileName</key>
<string>particle_star.png</string>
<key>textureImageData</key>
<string></string>
</dict>
</plist>
{
"ver": "2.0.1",
"uuid": "2e5a7ac3-8e00-4972-827d-f228a44a658d",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "117ff707-4a56-4176-8bf0-e9964648c54c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 46,
"height": 46,
"platformSettings": {},
"subMetas": {
"particle_star": {
"ver": "1.0.4",
"uuid": "abc22e46-06db-49c1-a651-a407dd798c35",
"rawTextureUuid": "117ff707-4a56-4176-8bf0-e9964648c54c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 46,
"height": 46,
"rawWidth": 46,
"rawHeight": 46,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e522bb89-f246-44cb-938b-ef1087e8cb70",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "e54c9f12-abe1-40b9-914b-aae37a47f64a",
"subMetas": {}
}
\ No newline at end of file
{"SubTexture":[{"width":539,"y":703,"height":546,"name":"老鼠 中间欢呼用 房清(1)/尾巴","x":728},{"width":339,"y":743,"height":420,"name":"老鼠 中间欢呼用 房清(1)/右手","x":1269},{"width":443,"y":1,"height":740,"name":"老鼠 中间欢呼用 房清(1)/圣体","x":1436},{"width":193,"y":1193,"height":745,"name":"老鼠 中间欢呼用 房清(1)/腿2","x":196},{"width":193,"y":1193,"height":746,"name":"老鼠 中间欢呼用 房清(1)/腿","x":1},{"width":725,"y":601,"height":590,"name":"老鼠 中间欢呼用 房清(1)/耳朵","x":1},{"width":640,"y":1,"height":700,"name":"老鼠 中间欢呼用 房清(1)/耳朵2","x":794},{"width":791,"y":1,"height":598,"name":"老鼠 中间欢呼用 房清(1)/头","x":1},{"width":452,"y":1165,"height":281,"name":"老鼠 中间欢呼用 房清(1)/右手(2)","x":1269},{"width":56,"y":601,"height":47,"name":"老鼠 中间欢呼用 房清(1)/鼻子","x":728},{"width":356,"y":900,"height":120,"name":"老鼠 中间欢呼用 房清(1)/图层11","x":1610},{"width":344,"y":743,"height":155,"name":"老鼠 中间欢呼用 房清(1)/眼睛(2)","x":1610},{"width":118,"y":1022,"height":97,"name":"老鼠 中间欢呼用 房清(1)/嘴巴","x":1610}],"width":2048,"height":2048,"name":"老鼠在欢呼","imagePath":"老鼠在欢呼_tex.png"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "d700fe52-897e-4b71-a055-61581390b662",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4fdf1ecf-a328-4df1-a7a1-2717abba75dc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"老鼠在欢呼_tex": {
"ver": "1.0.4",
"uuid": "a439a797-d8a1-4696-9906-bf63ce8970ce",
"rawTextureUuid": "4fdf1ecf-a328-4df1-a7a1-2717abba75dc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -40.5,
"offsetY": 54,
"trimX": 1,
"trimY": 1,
"width": 1965,
"height": 1938,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "94039f11-8428-459d-85e5-2d279603aa6d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "b57a560d-a20b-4f23-8bab-1fbfe01a577c",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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