Commit 369adb9a authored by linzhiguo's avatar linzhiguo

+ 增加个按钮看看

parent 370cea16
......@@ -17,7 +17,7 @@
"__id__": 2
},
{
"__id__": 245
"__id__": 252
}
],
"_active": false,
......@@ -127,18 +127,21 @@
},
{
"__id__": 239
},
{
"__id__": 242
}
],
"_active": true,
"_components": [
{
"__id__": 242
"__id__": 249
},
{
"__id__": 243
"__id__": 250
},
{
"__id__": 244
"__id__": 251
}
],
"_prefab": null,
......@@ -13150,6 +13153,379 @@
"_originalHeight": 0,
"_id": "7dXRGWhgJH258ElrfYD+8y"
},
{
"__type__": "cc.Node",
"_name": "New Button",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 243
}
],
"_active": true,
"_components": [
{
"__id__": 248
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 80
},
"_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": "84iMFM0h1G/46J7tow9WFq"
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 242
},
"_children": [
{
"__id__": 244
}
],
"_active": true,
"_components": [
{
"__id__": 246
},
{
"__id__": 247
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 80
},
"_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": "00sNdeVolLZrTo70rGwX6n"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 243
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 245
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 80
},
"_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": "cfPicLVtZDV643bUXWTU+f"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 244
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Start",
"_N$string": "Start",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "fabe0aa8-cd02-446b-843d-b57b30e55e66"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 1,
"_N$cacheMode": 1,
"_id": "b8zMrOdQpNLISqKMOq2zfY"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 243
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7bccr/QtdGMJn71FFDtwqF"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 243
},
"_enabled": true,
"alignMode": 0,
"_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": 100,
"_originalHeight": 40,
"_id": "31LISGbMJKCYdCUHBfVYnX"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 242
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_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": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 243
},
"_id": "ecDUB8dalBb4V+qWVVAZ/k"
},
{
"__type__": "cc.Canvas",
"_name": "",
......@@ -13242,10 +13618,10 @@
},
"_children": [
{
"__id__": 246
"__id__": 253
},
{
"__id__": 251
"__id__": 258
}
],
"_active": true,
......@@ -13303,11 +13679,11 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 245
"__id__": 252
},
"_children": [
{
"__id__": 247
"__id__": 254
}
],
"_active": true,
......@@ -13365,17 +13741,17 @@
"_name": "icon_0",
"_objFlags": 0,
"_parent": {
"__id__": 246
"__id__": 253
},
"_children": [
{
"__id__": 248
"__id__": 255
}
],
"_active": true,
"_components": [
{
"__id__": 250
"__id__": 257
}
],
"_prefab": null,
......@@ -13431,13 +13807,13 @@
"_name": "icon_1",
"_objFlags": 0,
"_parent": {
"__id__": 247
"__id__": 254
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 249
"__id__": 256
}
],
"_prefab": null,
......@@ -13493,7 +13869,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 248
"__id__": 255
},
"_enabled": true,
"_materials": [
......@@ -13525,7 +13901,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 247
"__id__": 254
},
"_enabled": true,
"_materials": [
......@@ -13557,26 +13933,29 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 245
"__id__": 252
},
"_children": [
{
"__id__": 252
"__id__": 259
},
{
"__id__": 254
"__id__": 261
},
{
"__id__": 256
"__id__": 263
},
{
"__id__": 258
"__id__": 265
},
{
"__id__": 260
"__id__": 267
},
{
"__id__": 262
"__id__": 269
},
{
"__id__": 271
}
],
"_active": true,
......@@ -13634,13 +14013,13 @@
"_name": "correct",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 253
"__id__": 260
}
],
"_prefab": null,
......@@ -13696,7 +14075,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 252
"__id__": 259
},
"_enabled": true,
"_clip": {
......@@ -13715,13 +14094,13 @@
"_name": "incorrect",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 255
"__id__": 262
}
],
"_prefab": null,
......@@ -13777,7 +14156,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 254
"__id__": 261
},
"_enabled": true,
"_clip": {
......@@ -13796,13 +14175,13 @@
"_name": "time321",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 257
"__id__": 264
}
],
"_prefab": null,
......@@ -13858,7 +14237,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 256
"__id__": 263
},
"_enabled": true,
"_clip": {
......@@ -13877,13 +14256,13 @@
"_name": "victory",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 259
"__id__": 266
}
],
"_prefab": null,
......@@ -13939,7 +14318,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 258
"__id__": 265
},
"_enabled": true,
"_clip": {
......@@ -13958,13 +14337,13 @@
"_name": "dizzy",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 261
"__id__": 268
}
],
"_prefab": null,
......@@ -14020,7 +14399,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 260
"__id__": 267
},
"_enabled": true,
"_clip": {
......@@ -14039,13 +14418,13 @@
"_name": "laugh",
"_objFlags": 0,
"_parent": {
"__id__": 251
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 263
"__id__": 270
}
],
"_prefab": null,
......@@ -14101,7 +14480,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 262
"__id__": 269
},
"_enabled": true,
"_clip": {
......@@ -14114,5 +14493,86 @@
"playOnLoad": false,
"preload": false,
"_id": "1d4PhMnNBCDaFKYmaJ2A0S"
},
{
"__type__": "cc.Node",
"_name": "lose",
"_objFlags": 0,
"_parent": {
"__id__": 258
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 272
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8cOMeIlfhBrbeqt+52TVJ4"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 271
},
"_enabled": true,
"_clip": {
"__uuid__": "fa5062c9-e0d3-4988-8e91-53e6cea9662d"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "0egZ7xXddB57XqgJ7VTV0+"
}
]
\ No newline at end of file
......@@ -134,14 +134,9 @@ cc.Class({
addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
},
addPreloadAudio() {
this._audioResList.push({ url: this.data.audio_url });
},
addPreloadAnima() {
......@@ -180,23 +175,10 @@ cc.Class({
this.title.string = this.data.title;
let audio_url = this.data.audio_url;
if (window && window.courseware) {
window.courseware.onEvent("course-in-screen", (data, next) => {
// 这里才能执行初始化就开始的东西
if (audio_url && audio_url!=""){
playAudioByUrl(audio_url, ()=>{
this.playGame();
});
}
else{
this.playGame();
}
next();
})
this._start = cc.find('Canvas/start');
this._start.on('click',()=>{
this._start.active = false;
return;
}
else{
if (audio_url && audio_url!=""){
playAudioByUrl(audio_url, ()=>{
this.playGame();
......@@ -204,9 +186,10 @@ cc.Class({
}
else{
this.playGame();
}
}
}
});
this.node.on(cc.Node.EventType.TOUCH_START, (event)=>{
if (!this._touched)
......
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