Commit af2553f3 authored by Tt's avatar Tt

初始化

parent c71b356e
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
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() {
}
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.initBg();
this.initPic();
this.initBtn();
this.initIcon();
}
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
}
pic1 = null;
pic2 = null;
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x;
canvas.addChild(picNode1);
this.pic1 = picNode1;
const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label);
label.string = this.data.text;
label.fontSize = 60;
label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode);
});
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2);
picNode2.x = canvas.width;
picNode2.baseX = picNode2.x;
this.pic2 = picNode2;
const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText);
const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size;
picNode2.addChild(labelNode);
});
}
initIcon() {
const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5;
iconNode.anchorX = 1;
iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url);
})
}
curPage = null;
initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级
bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 0) {
return;
}
this.curPage = 0
this.leftMove();
this.playLocalAudio('btn');
})
const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 1) {
return;
}
this.curPage = 1
this.rightMove();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
this.playLocalAudio('btn');
})
}
leftMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
rightMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
// update (dt) {},
initListener() {
}
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);
});
})
}
}
export const defaultData = {
"pic_url": "http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png",
"pic_url_2": "http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png",
"text": "This is a test label.",
"audio_url": "http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e89fc6c5-4bbb-4490-8b15-795d52049084",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7dd7d33d-05f5-4bc5-ad15-eada03f91ddb",
"downloadMode": 0,
"duration": 0.809796,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "01ba6fc8-62ac-4044-b1b0-f7acd880b83a",
"downloadMode": 0,
"duration": 1.097143,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "acfaeb39-1b57-422f-aae5-069e7f7646ee",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "0c3aaa79-608f-4c8a-bf1b-1728b24132fe",
"downloadMode": 0,
"duration": 3.552653,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "192daa61-9be8-42f5-a2f2-cbb533bda00d",
"downloadMode": 0,
"duration": 0.292667,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "e3fdd30b-860a-40e6-8ab5-6b2100bdfea0",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "42d102f5-20d9-4d10-a18b-763172762ac3",
"downloadMode": 0,
"duration": 1.959184,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "9786fb9f-7329-4b7d-8f6d-cc470dd5910f",
"downloadMode": 0,
"duration": 0.934618,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "cefcb7a2-50c8-4e2d-8e06-23d38f0c8391",
"downloadMode": 0,
"duration": 0.30325,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "c200f3e1-14f0-486f-8d70-ad332e832751",
"downloadMode": 0,
"duration": 1.567347,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "98714af7-8cbd-4b8a-971b-4ea24b4ff3d0",
"downloadMode": 0,
"duration": 1.306122,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1f13dc08-cec7-4217-b83f-d849f88e45e2",
"downloadMode": 0,
"duration": 0.835918,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "237ef4b0-e21a-4de7-acf1-993d64e41de1",
"downloadMode": 0,
"duration": 0.365714,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "e727dd73-b129-4f1a-baf2-c6d4bc120172",
"downloadMode": 0,
"duration": 0.287347,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "fa912cc9-47ec-4987-8798-2e432853a3aa",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "56ec52b1-ea8c-4e77-9ad2-152a7b04cddb",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "99481384-7524-4ecf-9623-d8466df57025",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "cafb4d03-522d-4674-879a-b8193c99d2b2",
"subMetas": {}
}
\ No newline at end of file
{"imagePath":"Excellent_tex.png","width":2048,"height":2048,"name":"Excellent","SubTexture":[{"width":161,"y":1849,"height":162,"name":"翅膀_左3","x":671},{"width":161,"y":1849,"height":162,"name":"翅膀_左2","x":508},{"width":160,"y":1849,"height":162,"name":"翅膀_左1","x":834},{"width":161,"y":604,"height":162,"name":"翅膀_右3","x":1864},{"width":161,"y":440,"height":162,"name":"翅膀_右2","x":1864},{"width":160,"y":723,"height":162,"name":"翅膀_右1","x":1532},{"width":391,"y":1,"height":437,"name":"菱形","x":1532},{"width":330,"y":440,"height":281,"name":"虎头Excellent","x":1532},{"width":505,"y":1849,"height":151,"name":"Excellent","x":1},{"width":45,"y":39,"height":30,"name":"糖1","x":2000},{"width":41,"y":1,"height":36,"name":"糖2","x":2000},{"width":39,"y":1,"height":61,"name":"糖3","x":1925},{"width":32,"y":1,"height":49,"name":"糖4","x":1966},{"width":19,"y":80,"height":25,"name":"糖5","x":1952},{"width":26,"y":52,"height":26,"name":"糖6","x":1966},{"width":20,"y":107,"height":24,"name":"糖7","x":2021},{"width":15,"y":80,"height":16,"name":"糖8","x":1973},{"width":15,"y":98,"height":16,"name":"糖9","x":1973},{"width":15,"y":91,"height":16,"name":"糖10","x":1925},{"width":25,"y":64,"height":25,"name":"糖11","x":1925},{"width":25,"y":80,"height":25,"name":"糖12","x":2021},{"width":25,"y":71,"height":25,"name":"糖13","x":1994},{"width":50,"y":2002,"height":27,"name":"糖14","x":1},{"width":862,"y":985,"height":862,"name":"光4","x":1},{"frameY":-74,"y":1,"frameWidth":1920,"frameX":-164,"frameHeight":1080,"width":1529,"height":982,"name":"光","x":1}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "14afe0ae-e556-497f-bf9e-0aab665b5693",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "2db45808-9651-4462-b6a2-cb9b013664ed",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"Excellent_tex": {
"ver": "1.0.4",
"uuid": "d705d261-275e-4c27-aca0-d5e234e77f62",
"rawTextureUuid": "2db45808-9651-4462-b6a2-cb9b013664ed",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 9,
"trimX": 1,
"trimY": 1,
"width": 2045,
"height": 2028,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a2b070a7-4df7-4591-91b7-bcb74ca2d828",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "c9cb8190-feb9-4295-a068-9669e36839ad",
"subMetas": {}
}
\ No newline at end of file
{"imagePath":"Good_tex.png","width":2048,"height":2048,"name":"Good","SubTexture":[{"width":161,"y":1849,"height":162,"name":"翅膀_左3","x":671},{"width":161,"y":604,"height":162,"name":"翅膀_左2","x":1861},{"width":160,"y":1849,"height":162,"name":"翅膀_左1","x":834},{"width":161,"y":1849,"height":162,"name":"翅膀_右3","x":508},{"width":161,"y":440,"height":162,"name":"翅膀_右2","x":1861},{"width":160,"y":722,"height":162,"name":"翅膀_右1","x":1532},{"width":391,"y":1,"height":437,"name":"菱形","x":1532},{"width":327,"y":440,"height":280,"name":"虎头Good_","x":1532},{"width":505,"y":1849,"height":151,"name":"Good_","x":1},{"width":45,"y":39,"height":30,"name":"糖1","x":2000},{"width":41,"y":1,"height":36,"name":"糖2","x":2000},{"width":39,"y":1,"height":61,"name":"糖3","x":1925},{"width":32,"y":1,"height":49,"name":"糖4","x":1966},{"width":19,"y":80,"height":25,"name":"糖5","x":1952},{"width":26,"y":52,"height":26,"name":"糖6","x":1966},{"width":20,"y":107,"height":24,"name":"糖7","x":2021},{"width":15,"y":80,"height":16,"name":"糖8","x":1973},{"width":15,"y":98,"height":16,"name":"糖9","x":1973},{"width":15,"y":91,"height":16,"name":"糖10","x":1925},{"width":25,"y":80,"height":25,"name":"糖11","x":2021},{"width":25,"y":71,"height":25,"name":"糖12","x":1994},{"width":25,"y":64,"height":25,"name":"糖13","x":1925},{"width":50,"y":2002,"height":27,"name":"糖14","x":1},{"width":862,"y":985,"height":862,"name":"光4","x":1},{"frameY":-74,"y":1,"frameWidth":1920,"frameX":-164,"frameHeight":1080,"width":1529,"height":982,"name":"光","x":1}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "0d2c601a-6231-45ad-9d1f-d5d51092137b",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "95c85916-c868-46a2-8d51-31d4f1a96c4a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"Good_tex": {
"ver": "1.0.4",
"uuid": "b6ef27ca-bd13-41f2-80ed-6fa70a53ed8e",
"rawTextureUuid": "95c85916-c868-46a2-8d51-31d4f1a96c4a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 9,
"trimX": 1,
"trimY": 1,
"width": 2045,
"height": 2028,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "8c9909a4-3e62-490f-868c-0bac3ff42e93",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "ecd349c0-ad88-4ef1-ace6-27e9ead1d200",
"subMetas": {}
}
\ No newline at end of file
{"name":"lypc","imagePath":"lypc_tex.png","SubTexture":[{"name":"7","x":1,"height":69,"y":1,"width":11},{"name":"6","x":14,"height":45,"y":1,"width":11},{"name":"5","x":40,"height":27,"y":1,"width":11},{"name":"4","x":1,"height":47,"y":72,"width":11},{"name":"3","x":27,"height":27,"y":1,"width":11},{"name":"2","x":14,"height":38,"y":48,"width":11},{"name":"1","x":14,"height":28,"y":88,"width":11}],"height":128,"width":64}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "bfff0b42-e9cc-4302-8ce3-5e421411d054",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "53bc8d78-30ec-4d2a-9d04-5b6f6d9f9699",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 128,
"platformSettings": {},
"subMetas": {
"lypc_tex": {
"ver": "1.0.4",
"uuid": "5bff2042-cef6-4236-9e63-4db54d4a3b07",
"rawTextureUuid": "53bc8d78-30ec-4d2a-9d04-5b6f6d9f9699",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -6,
"offsetY": 4,
"trimX": 1,
"trimY": 1,
"width": 50,
"height": 118,
"rawWidth": 64,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "33ffebb4-44c5-4715-812c-c216797584e9",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "b42b295e-67a2-4856-abff-b0f11377e257",
"subMetas": {}
}
\ No newline at end of file
{"imagePath":"Try_again_tex.png","width":2048,"height":2048,"name":"Try_again","SubTexture":[{"width":161,"y":1849,"height":162,"name":"翅膀_左3","x":671},{"width":161,"y":440,"height":162,"name":"翅膀_左2","x":1865},{"width":160,"y":717,"height":162,"name":"翅膀_左1","x":1532},{"width":161,"y":604,"height":162,"name":"翅膀_右3","x":1865},{"width":161,"y":1849,"height":162,"name":"翅膀_右2","x":508},{"width":160,"y":1849,"height":162,"name":"翅膀_右1","x":834},{"width":391,"y":1,"height":437,"name":"菱形","x":1532},{"width":331,"y":440,"height":275,"name":"虎头Try_again","x":1532},{"width":505,"y":1849,"height":151,"name":"Try_again","x":1},{"width":45,"y":39,"height":30,"name":"糖1","x":2000},{"width":41,"y":1,"height":36,"name":"糖2","x":2000},{"width":39,"y":1,"height":61,"name":"糖3","x":1925},{"width":32,"y":1,"height":49,"name":"糖4","x":1966},{"width":19,"y":80,"height":25,"name":"糖5","x":1952},{"width":26,"y":52,"height":26,"name":"糖6","x":1966},{"width":20,"y":107,"height":24,"name":"糖7","x":2021},{"width":15,"y":91,"height":16,"name":"糖8","x":1925},{"width":15,"y":98,"height":16,"name":"糖9","x":1973},{"width":15,"y":80,"height":16,"name":"糖10","x":1973},{"width":25,"y":80,"height":25,"name":"糖11","x":2021},{"width":25,"y":71,"height":25,"name":"糖12","x":1994},{"width":25,"y":64,"height":25,"name":"糖13","x":1925},{"width":50,"y":2002,"height":27,"name":"糖14","x":1},{"width":862,"y":985,"height":862,"name":"光4","x":1},{"frameY":-74,"y":1,"frameWidth":1920,"frameX":-164,"frameHeight":1080,"width":1529,"height":982,"name":"光","x":1}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "1281c03b-70f7-44b4-8cd7-be6328cc711e",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "75678f20-f6cf-4ad9-befa-e281f31a9164",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"Try_again_tex": {
"ver": "1.0.4",
"uuid": "e7290793-aaa6-4c91-be52-22ec5fc6746b",
"rawTextureUuid": "75678f20-f6cf-4ad9-befa-e281f31a9164",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 9,
"trimX": 1,
"trimY": 1,
"width": 2045,
"height": 2028,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "11e832db-90f0-4e9f-9e25-ccb938b565fd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "674f97a3-1898-4235-9473-17c357c39605",
"downloadMode": 0,
"duration": 1.8137,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "bafa4c84-01c2-4d6c-8343-745066eed098",
"downloadMode": 0,
"duration": 1.097125,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "78f18bf7-e329-4386-aaee-1b6737fe5a03",
"downloadMode": 0,
"duration": 1.071,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "3796b67a-a501-40dc-a1b1-8ea234651d9e",
"downloadMode": 0,
"duration": 1.1755,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "19a64a93-34ed-4e65-9303-d0a268c1803c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "927f6c73-f3af-4c69-a990-9dc6668dbb70",
"subMetas": {}
}
\ No newline at end of file
// pg.event.emit('npc_layer_back_init',{ })
// pg.event.emit('npc_voice_play_voice_start')
// pg.event.emit('npc_voice_play_voice_end')
import pg from "../../scene/pg_jj16_lianci";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LayerBack extends cc.Component {
private btn_back: cc.Node;
private img_npc_voice: cc.Node;
private bg_forbid: cc.Node;
onLoad() {
this.initView();
this.initEvent();
}
protected onDestroy(): void {
this.unscheduleAllCallbacks();
}
private label_title: cc.Node;
initView() {
this.bg_forbid = pg.view.find(this, 'bg_forbid')
this.btn_back = pg.view.find(this, 'btn_back')
this.label_title = pg.view.find(this, 'label_title')
this.img_npc_voice = pg.view.find(this.label_title, 'img_npc_voice')
pg.view.touchOn(this.img_npc_voice, this.playVoiceStart, this);
}
private npcTitle: string;
private npcAudio: string;
updateView(data) {
this.npcTitle = data.npcTitle
this.npcAudio = data.npcAudio
pg.view.visible(this.img_npc_voice, this.npcAudio)
pg.view.visible(this.label_title, this.npcTitle)
pg.view.setString(this.label_title, this.npcTitle);
}
initEvent() {
pg.view.touchOn(this.btn_back, this.onTouchBack, this)
pg.event.on('npc_layer_back_init', (data) => {
this.updateView(data);
if (!this.npcAudio) {
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end');
} else {
this.playVoiceStart();
}
})
}
private playVoiceCount: number;
private audioId: number;
playVoiceStart() {
if (this.playVoiceCount > 0) {
if (this.audioId) cc.audioEngine.stopEffect(this.audioId);
this.playVoiceEnd();
}
this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.playVoiceEnd();
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
});
}
playVoiceRunning() {
this.playVoiceCount++;
let p1 = this.img_npc_voice.getChildByName('p1')
let p2 = this.img_npc_voice.getChildByName('p2')
let p3 = this.img_npc_voice.getChildByName('p3')
p1.active = this.playVoiceCount % 3 == 0;
p2.active = this.playVoiceCount % 3 == 1;
p3.active = this.playVoiceCount % 3 == 2;
}
playVoiceEnd() {
this.unschedule(this.playVoiceRunning)
this.playVoiceCount = 0;
let p1 = this.img_npc_voice.getChildByName('p1')
let p2 = this.img_npc_voice.getChildByName('p2')
let p3 = this.img_npc_voice.getChildByName('p3')
p1.active = true;
p2.active = false;
p3.active = false;
}
onTouchBack() {
const middleLayer = cc.find('middleLayer');
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.exitGame();
}
}
{
"ver": "1.0.8",
"uuid": "7ab718ad-47f8-49cf-8822-085a39c85075",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "508c4cc0-7802-495f-8c13-85a2a81c52cd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d1d55630-4512-4f78-8346-b1004ac24fce",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d3006e79-2315-4059-8aee-8e7a4d56121f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 202,
"height": 117,
"platformSettings": {},
"subMetas": {
"back_jj16_lianci": {
"ver": "1.0.4",
"uuid": "92327074-92fd-4d4a-a8aa-32f7ed514ab1",
"rawTextureUuid": "d3006e79-2315-4059-8aee-8e7a4d56121f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -6.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 189,
"height": 117,
"rawWidth": 202,
"rawHeight": 117,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a73899c7-e729-4b69-82a5-4cf3eecb2f48",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "593366d0-c41f-40dd-8cfa-72e2fbdb78b8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 95,
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger1_jj16_lianci": {
"ver": "1.0.4",
"uuid": "008bbd55-b1e7-4e82-bf54-f6cf40ebb738",
"rawTextureUuid": "593366d0-c41f-40dd-8cfa-72e2fbdb78b8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -5.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 84,
"height": 70,
"rawWidth": 95,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f6f170f4-59de-40e0-b666-1ddaf58a6997",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 95,
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger2_jj16_lianci": {
"ver": "1.0.4",
"uuid": "603d0882-deba-4173-8432-b9da5e547d20",
"rawTextureUuid": "f6f170f4-59de-40e0-b666-1ddaf58a6997",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 95,
"height": 70,
"rawWidth": 95,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ffa50fcc-6561-4673-8e93-5e4abf03d963",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 95,
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger_jj16_lianci": {
"ver": "1.0.4",
"uuid": "5d214bcc-ae6a-48b2-8e3e-693089d66911",
"rawTextureUuid": "ffa50fcc-6561-4673-8e93-5e4abf03d963",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -13.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 68,
"height": 70,
"rawWidth": 95,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "5302f1d3-299b-4ec3-82d6-b6229fca203f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a36cd0ec-3891-435e-968b-934c346aa8dc",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "815cbe35-e740-4514-a84b-9fa42bd3957f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4c8b7a1c-163d-4358-811b-1c79de3c9b9b",
"subMetas": {}
}
\ No newline at end of file
{"name":"金币","SubTexture":[{"name":"金币动画/金币底","x":1,"height":181,"y":181,"width":172},{"name":"金币动画/条","x":175,"height":18,"y":181,"width":9},{"name":"金币动画/圈","x":1,"height":178,"y":1,"width":218},{"name":"金币动画/金币","x":221,"height":185,"y":1,"width":178}],"height":512,"imagePath":"coin1_tex_hy01_danci.png","width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "d0a6e7e0-94c8-4828-bd3e-ab5d98f0a611",
"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.
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.
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.
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.
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.
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