Commit ff7f7c72 authored by 范雪寒's avatar 范雪寒

feat: 更改为prefab的形式,便于导出

parent 7f038a34
File added
{
"ver": "1.1.2",
"uuid": "aafdf165-a49b-4d39-9272-f86513fed793",
"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": "StarScore",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 6
}
],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": {
"__id__": 16
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"height": 500
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
600,
320,
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.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 50,
"height": 500
},
"_resize": 0,
"_N$layoutType": 3,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 1,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 10,
"_N$spacingY": 10,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 1,
"_N$affectedByScale": true,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 40,
"_top": 40,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "98QDT4j/ZP8JxEnUEDU0j8",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "StarBase",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 7
}
],
"_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": 62,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-833.71,
-508.737,
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",
"_objFlags": 0,
"_parent": {
"__id__": 6
},
"_children": [
{
"__id__": 8
}
],
"_active": false,
"_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": 62,
"height": 69
},
"_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": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_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": 278,
"height": 275
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
-0.7071067811865475,
0.7071067811865476,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": -90
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b00d89ac-54ee-4b06-878a-acef8c97f0df"
},
"_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": {
"__id__": 0
},
"fileId": "c0jvvYWS5EbZXy198BfKF0",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f72965fe-cf21-4551-adcb-6bdc04be67a0"
},
"_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": {
"__id__": 0
},
"fileId": "6alefhtH9DRoDtggQRJAoB",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "542bf56d-a861-4e7d-8235-cd0cb39a7ba9"
},
"_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": {
"__id__": 0
},
"fileId": "a7ZpDZc/BBB5NyG9IaSlNq",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
const {ccclass, property} = cc._decorator;
@ccclass
export default class StarScore extends cc.Component {
starLength = 0;
addStar() {
this.starLength++;
let length = this.starLength;
const starLayout = cc.find('layout', this.node);
starLayout.removeAllChildren();
const paddingY = starLayout.getComponent(cc.Layout).spacingY;
for (let i = 0; i < length; i++) {
const starBase = cc.instantiate(cc.find('StarBase', this.node));
starBase.name = `starBase_${i}`;
starBase.scale = this.Between(0.5, (starLayout.height / length - paddingY) / starBase.height, 1);
starBase.parent = starLayout;
}
this.currentStarIdx = 0;
}
currentStarIdx = 0;
showStar() {
const starBase = cc.find(`layout/starBase_${this.currentStarIdx}`, this.node);
if (!starBase) {
return;
}
const star = starBase.getChildByName('Star');
const starBig = star.getChildByName('StarBig');
starBig.scale = 1;
star.active = true;
star.scaleX = 0.7 / starBase.scale;
star.scaleY = 1 / starBase.scale;
star.angle = 90;
const canvas = cc.find('Canvas');
const startPos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 2));
const middlePos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 4));
star.x = startPos.x;
star.y = startPos.y - starBig.height;
console.log('middlePos = ' + JSON.stringify(middlePos));
cc.tween(star)
.to(0.3, { y: middlePos.y + 80 }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y + 40, scaleX: 1.2 / starBase.scale, scaleY: 0.8 / starBase.scale }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y, scaleX: 1 / starBase.scale, scaleY: 1 / starBase.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(() => {
// this.checkGameEnd();
})
.start();
this.currentStarIdx++;
}
Between(a, b, c) {
return [a, b, c].sort()[1];
}
exchangeNodePos(targetNode, baseNode, basePos) {
return targetNode.convertToNodeSpaceAR(baseNode.convertToWorldSpaceAR(cc.v2(basePos.x, basePos.y)));
}
}
{
"ver": "1.0.8",
"uuid": "0857bc6c-6ff1-4e05-966e-0c1db1fa3dc2",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 27
} }
], ],
"_active": true, "_active": true,
...@@ -78,22 +75,22 @@ ...@@ -78,22 +75,22 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 8 "__id__": 22
}, },
{ {
"__id__": 16 "__id__": 30
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 38
}, },
{ {
"__id__": 25 "__id__": 39
}, },
{ {
"__id__": 26 "__id__": 40
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -244,22 +241,98 @@ ...@@ -244,22 +241,98 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "layout", "_name": "StarScore",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [
{
"__id__": 6
},
{
"__id__": 10
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 19
}, },
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": "056t30NDVIarSH0ZbCRb1m"
},
{
"__type__": "cc.Node",
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{ {
"__id__": 7 "__id__": 7
},
{
"__id__": 8
} }
], ],
"_prefab": null, "_prefab": {
"__id__": 9
},
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
...@@ -312,7 +385,7 @@ ...@@ -312,7 +385,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 6
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -344,10 +417,10 @@ ...@@ -344,10 +417,10 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 6
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 33, "_alignFlags": 33,
"_left": 0, "_left": 0,
...@@ -366,28 +439,38 @@ ...@@ -366,28 +439,38 @@
"_originalHeight": 0, "_originalHeight": 0,
"_id": "d7gnmxSWJPV4wGWih5+7Hx" "_id": "d7gnmxSWJPV4wGWih5+7Hx"
}, },
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0"
},
"fileId": "98QDT4j/ZP8JxEnUEDU0j8",
"sync": false
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "BtnShowStar", "_name": "StarBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 5
}, },
"_children": [ "_children": [
{ {
"__id__": 9 "__id__": 11
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 14 "__id__": 17
},
{
"__id__": 15
} }
], ],
"_prefab": null, "_prefab": {
"__id__": 18
},
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
...@@ -398,8 +481,8 @@ ...@@ -398,8 +481,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 62,
"height": 40 "height": 66
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -410,8 +493,8 @@ ...@@ -410,8 +493,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
200, -833.71,
-310, -508.737,
0, 0,
0, 0,
0, 0,
...@@ -433,30 +516,29 @@ ...@@ -433,30 +516,29 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "1dJvlXTo9NSpvfMQHJ7D8m" "_id": "caYUJQLsRA5raLY3euWf0C"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Background", "_name": "Star",
"_objFlags": 512, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 8 "__id__": 10
}, },
"_children": [ "_children": [
{ {
"__id__": 10 "__id__": 12
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 15
},
{
"__id__": 13
} }
], ],
"_prefab": null, "_prefab": {
"__id__": 16
},
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
...@@ -467,8 +549,8 @@ ...@@ -467,8 +549,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 62,
"height": 40 "height": 69
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -502,35 +584,37 @@ ...@@ -502,35 +584,37 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "d1o3DwgQJOA731lniEE8ch" "_id": "1ei0HhhfNI55S64CkxHS+5"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Label", "_name": "StarBig",
"_objFlags": 512, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 9 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 11 "__id__": 13
} }
], ],
"_prefab": null, "_prefab": {
"__id__": 14
},
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 0, "r": 255,
"g": 0, "g": 255,
"b": 0, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 278,
"height": 40 "height": 275
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -546,8 +630,8 @@ ...@@ -546,8 +630,8 @@
0, 0,
0, 0,
0, 0,
0, -0.7071067811865475,
1, 0.7071067811865476,
1, 1,
1, 1,
1 1
...@@ -557,21 +641,21 @@ ...@@ -557,21 +641,21 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": -90
}, },
"_skewX": 0, "_skewX": 0,
"_skewY": 0, "_skewY": 0,
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "b9XwNjhRFDQ484uhJJDHKa" "_id": "3f7u5hhEZJvaLGSJYAKli0"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 10 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -581,30 +665,40 @@ ...@@ -581,30 +665,40 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "播放", "_spriteFrame": {
"_N$string": "播放", "__uuid__": "b00d89ac-54ee-4b06-878a-acef8c97f0df"
"_fontSize": 20, },
"_lineHeight": 40, "_type": 0,
"_enableWrapText": false, "_sizeMode": 1,
"_N$file": null, "_fillType": 0,
"_isSystemFontUsed": true, "_fillCenter": {
"_spacingX": 0, "__type__": "cc.Vec2",
"_batchAsBitmap": false, "x": 0,
"_styleFlags": 0, "y": 0
"_underlineHeight": 0, },
"_N$horizontalAlign": 1, "_fillStart": 0,
"_N$verticalAlign": 1, "_fillRange": 0,
"_N$fontFamily": "Arial", "_isTrimmedMode": true,
"_N$overflow": 1, "_atlas": null,
"_N$cacheMode": 1, "_id": "aebDpLzF5N5aVHTOPJ56UN"
"_id": "77QON6XRxLWbPlcJmOVdfp" },
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0"
},
"fileId": "c0jvvYWS5EbZXy198BfKF0",
"sync": false
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 9 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -615,10 +709,10 @@ ...@@ -615,10 +709,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" "__uuid__": "f72965fe-cf21-4551-adcb-6bdc04be67a0"
}, },
"_type": 1, "_type": 0,
"_sizeMode": 0, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -629,134 +723,79 @@ ...@@ -629,134 +723,79 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "73VqOCOstGeIWvE3JqS/V7" "_id": "0civ9QyulAUbDVzlMv7XVa"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.PrefabInfo",
"_name": "", "root": {
"_objFlags": 0, "__id__": 5
"node": {
"__id__": 9
}, },
"_enabled": true, "asset": {
"alignMode": 0, "__uuid__": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0"
"_target": null, },
"_alignFlags": 45, "fileId": "6alefhtH9DRoDtggQRJAoB",
"_left": 0, "sync": false
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "071bHfRGxKUrsYWhCAdWe/"
}, },
{ {
"__type__": "cc.Button", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 10
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_materials": [
"_grayMaterial": null, {
"duration": 0.1, "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
"zoomScale": 1.2, }
"clickEvents": [], ],
"_N$interactable": true, "_srcBlendFactor": 770,
"_N$enableAutoGrayEffect": false, "_dstBlendFactor": 771,
"_N$transition": 2, "_spriteFrame": {
"transition": 2, "__uuid__": "542bf56d-a861-4e7d-8235-cd0cb39a7ba9"
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
}, },
"hoverSprite": { "_type": 0,
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" "_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
}, },
"_N$disabledSprite": { "_fillStart": 0,
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6cOaTXFFhMNL1V2Pj1N8xd"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
}, },
"_N$target": { "asset": {
"__id__": 9 "__uuid__": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0"
}, },
"_id": "9eXZnPPItIwaJ6QyH6KKd/" "fileId": "a7ZpDZc/BBB5NyG9IaSlNq",
"sync": false
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 20, "_alignFlags": 45,
"_left": 0, "_left": 0,
"_right": 213, "_right": 0,
"_top": 0, "_top": 0,
"_bottom": 30, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 200, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,
"_isAbsTop": true, "_isAbsTop": true,
...@@ -765,27 +804,50 @@ ...@@ -765,27 +804,50 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "953bIyAnlI8Li4AkmntVgA" "_id": "e9GKWUSm1B8JoaC3orwy/L"
},
{
"__type__": "0857bxsb/FOBZZuDB2x+j3C",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"label": null,
"text": "hello",
"_id": "feUJnYCjZAE724ocsgAGel"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "cb251ca0-8be4-41e6-9c06-6461d59ff7c0"
},
"fileId": "",
"sync": false
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "BtnAddStar", "_name": "BtnShowStar",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [ "_children": [
{ {
"__id__": 17 "__id__": 23
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 22 "__id__": 28
}, },
{ {
"__id__": 23 "__id__": 29
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -811,7 +873,7 @@ ...@@ -811,7 +873,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-200, 200,
-310, -310,
0, 0,
0, 0,
...@@ -834,27 +896,27 @@ ...@@ -834,27 +896,27 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "0ceHmZk1hGO4j0cKMB8KsG" "_id": "1dJvlXTo9NSpvfMQHJ7D8m"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Background", "_name": "Background",
"_objFlags": 512, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 16 "__id__": 22
}, },
"_children": [ "_children": [
{ {
"__id__": 18 "__id__": 24
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 20 "__id__": 26
}, },
{ {
"__id__": 21 "__id__": 27
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -903,20 +965,20 @@ ...@@ -903,20 +965,20 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "83JdtqpLhIsoN6oCCXXi1H" "_id": "d1o3DwgQJOA731lniEE8ch"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Label", "_name": "Label",
"_objFlags": 512, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 17 "__id__": 23
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 25
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -965,14 +1027,14 @@ ...@@ -965,14 +1027,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "d57GBcQSpCi6cec1I7sN8j" "_id": "b9XwNjhRFDQ484uhJJDHKa"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 18 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -982,8 +1044,8 @@ ...@@ -982,8 +1044,8 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "增加星星", "_string": "播放",
"_N$string": "增加星星", "_N$string": "播放",
"_fontSize": 20, "_fontSize": 20,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": false, "_enableWrapText": false,
...@@ -998,14 +1060,14 @@ ...@@ -998,14 +1060,14 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 1, "_N$overflow": 1,
"_N$cacheMode": 1, "_N$cacheMode": 1,
"_id": "bdtX88qdFJsJyQtT9jmZMT" "_id": "77QON6XRxLWbPlcJmOVdfp"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 17 "__id__": 23
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1030,14 +1092,14 @@ ...@@ -1030,14 +1092,14 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "baaIwLupVGqatQGUxpQOkO" "_id": "73VqOCOstGeIWvE3JqS/V7"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 17 "__id__": 23
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
...@@ -1057,14 +1119,14 @@ ...@@ -1057,14 +1119,14 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 100, "_originalWidth": 100,
"_originalHeight": 40, "_originalHeight": 40,
"_id": "97S5yj4PhCVI5UFMrd//gL" "_id": "071bHfRGxKUrsYWhCAdWe/"
}, },
{ {
"__type__": "cc.Button", "__type__": "cc.Button",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 22
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -1137,71 +1199,27 @@ ...@@ -1137,71 +1199,27 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
}, },
"_N$target": { "_N$target": {
"__id__": 17 "__id__": 23
}, },
"_id": "175x0yGZhMuYnDccKEjZC+" "_id": "9eXZnPPItIwaJ6QyH6KKd/"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 22
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 20, "_alignFlags": 20,
"_left": 0, "_left": 0,
"_right": 0, "_right": 213,
"_top": 0, "_top": 0,
"_bottom": 30, "_bottom": 30,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": -200, "_horizontalCenter": 200,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "28REOmxdtFIYG6KHBo6VmY"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,
"_isAbsTop": true, "_isAbsTop": true,
...@@ -1210,34 +1228,27 @@ ...@@ -1210,34 +1228,27 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe" "_id": "953bIyAnlI8Li4AkmntVgA"
},
{
"__type__": "52c4dVvmxZDkr2ojYl0ZDZW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "e1/+u9dO9NBJk48O/QUQdP"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "StarBase", "_name": "BtnAddStar",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1 "__id__": 2
}, },
"_children": [ "_children": [
{ {
"__id__": 28 "__id__": 31
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 32 "__id__": 36
},
{
"__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1251,8 +1262,8 @@ ...@@ -1251,8 +1262,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 62, "width": 100,
"height": 66 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1263,8 +1274,8 @@ ...@@ -1263,8 +1274,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-193.71, -200,
-148.737, -310,
0, 0,
0, 0,
0, 0,
...@@ -1286,24 +1297,27 @@ ...@@ -1286,24 +1297,27 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "caYUJQLsRA5raLY3euWf0C" "_id": "0ceHmZk1hGO4j0cKMB8KsG"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Star", "_name": "Background",
"_objFlags": 0, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 27 "__id__": 30
}, },
"_children": [ "_children": [
{ {
"__id__": 29 "__id__": 32
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 31 "__id__": 34
},
{
"__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1317,8 +1331,8 @@ ...@@ -1317,8 +1331,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 62, "width": 100,
"height": 69 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1352,35 +1366,35 @@ ...@@ -1352,35 +1366,35 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "1ei0HhhfNI55S64CkxHS+5" "_id": "83JdtqpLhIsoN6oCCXXi1H"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "StarBig", "_name": "Label",
"_objFlags": 0, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 28 "__id__": 31
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 33
} }
], ],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 0,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 278, "width": 100,
"height": 275 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1396,8 +1410,8 @@ ...@@ -1396,8 +1410,8 @@
0, 0,
0, 0,
0, 0,
-0.7071067811865475, 0,
0.7071067811865476, 1,
1, 1,
1, 1,
1 1
...@@ -1407,21 +1421,21 @@ ...@@ -1407,21 +1421,21 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": -90 "z": 0
}, },
"_skewX": 0, "_skewX": 0,
"_skewY": 0, "_skewY": 0,
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "3f7u5hhEZJvaLGSJYAKli0" "_id": "d57GBcQSpCi6cec1I7sN8j"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Label",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1431,29 +1445,30 @@ ...@@ -1431,29 +1445,30 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_string": "增加星星",
"__uuid__": "b00d89ac-54ee-4b06-878a-acef8c97f0df" "_N$string": "增加星星",
}, "_fontSize": 20,
"_type": 0, "_lineHeight": 40,
"_sizeMode": 1, "_enableWrapText": false,
"_fillType": 0, "_N$file": null,
"_fillCenter": { "_isSystemFontUsed": true,
"__type__": "cc.Vec2", "_spacingX": 0,
"x": 0, "_batchAsBitmap": false,
"y": 0 "_styleFlags": 0,
}, "_underlineHeight": 0,
"_fillStart": 0, "_N$horizontalAlign": 1,
"_fillRange": 0, "_N$verticalAlign": 1,
"_isTrimmedMode": true, "_N$fontFamily": "Arial",
"_atlas": null, "_N$overflow": 1,
"_id": "aebDpLzF5N5aVHTOPJ56UN" "_N$cacheMode": 1,
"_id": "bdtX88qdFJsJyQtT9jmZMT"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 28 "__id__": 31
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1464,10 +1479,10 @@ ...@@ -1464,10 +1479,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "f72965fe-cf21-4551-adcb-6bdc04be67a0" "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
}, },
"_type": 0, "_type": 1,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1478,38 +1493,196 @@ ...@@ -1478,38 +1493,196 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "0civ9QyulAUbDVzlMv7XVa" "_id": "baaIwLupVGqatQGUxpQOkO"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 27 "__id__": 31
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "alignMode": 0,
{ "_target": null,
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "_alignFlags": 45,
} "_left": 0,
], "_right": 0,
"_srcBlendFactor": 770, "_top": 0,
"_dstBlendFactor": 771, "_bottom": 0,
"_spriteFrame": { "_verticalCenter": 0,
"__uuid__": "542bf56d-a861-4e7d-8235-cd0cb39a7ba9" "_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "97S5yj4PhCVI5UFMrd//gL"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
}, },
"_type": 0, "_enabled": true,
"_sizeMode": 1, "_normalMaterial": null,
"_fillType": 0, "_grayMaterial": null,
"_fillCenter": { "duration": 0.1,
"__type__": "cc.Vec2", "zoomScale": 1.2,
"x": 0, "clickEvents": [],
"y": 0 "_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
}, },
"_fillStart": 0, "_N$pressedColor": {
"_fillRange": 0, "__type__": "cc.Color",
"_isTrimmedMode": true, "r": 200,
"_atlas": null, "g": 200,
"_id": "6cOaTXFFhMNL1V2Pj1N8xd" "b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 31
},
"_id": "175x0yGZhMuYnDccKEjZC+"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 20,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 30,
"_verticalCenter": 0,
"_horizontalCenter": -200,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "28REOmxdtFIYG6KHBo6VmY"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "52c4dVvmxZDkr2ojYl0ZDZW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "e1/+u9dO9NBJk48O/QUQdP"
} }
] ]
\ No newline at end of file
...@@ -22,86 +22,11 @@ cc.Class({ ...@@ -22,86 +22,11 @@ cc.Class({
BtnShowStar.on('click', this.showStar.bind(this)); BtnShowStar.on('click', this.showStar.bind(this));
}, },
starLength: null,
addStar() { addStar() {
if (!this.starLength) { cc.find('Canvas/StarScore').getComponent('StarScore').addStar();
this.starLength = 0;
}
this.starLength++;
let length = this.starLength;
const starLayout = cc.find('Canvas/layout');
starLayout.removeAllChildren();
const paddingY = starLayout.getComponent(cc.Layout).spacingY;
for (let i = 0; i < length; i++) {
const starBase = cc.instantiate(cc.find('StarBase'));
starBase.name = `starBase_${i}`;
starBase.scale = this.Between(0.5, (starLayout.height / length - paddingY) / starBase.height, 1);
starBase.parent = starLayout;
}
this.currentStarIdx = 0;
}, },
currentStarIdx: null,
showStar() { showStar() {
if (!this.currentStarIdx) { cc.find('Canvas/StarScore').getComponent('StarScore').showStar();
this.currentStarIdx = 0;
}
const starBase = cc.find(`Canvas/layout/starBase_${this.currentStarIdx}`);
if (!starBase) {
return;
}
const star = starBase.getChildByName('Star');
const starBig = star.getChildByName('StarBig');
starBig.scale = 1;
star.active = true;
star.scaleX = 0.7 / starBase.scale;
star.scaleY = 1 / starBase.scale;
star.angle = 90;
const canvas = cc.find('Canvas');
const startPos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 2));
const middlePos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 4));
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 / starBase.scale, scaleY: 0.8 / starBase.scale }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y, scaleX: 1 / starBase.scale, scaleY: 1 / starBase.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(() => {
// this.checkGameEnd();
})
.start();
this.currentStarIdx++;
},
Between(a, b, c) {
return [a, b, c].sort()[1];
}, },
exchangeNodePos(targetNode, baseNode, basePos) {
return targetNode.convertToNodeSpaceAR(baseNode.convertToWorldSpaceAR(cc.v2(basePos.x, basePos.y)));
},
}); });
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