Commit 6495f1c6 authored by Tt's avatar Tt

修改001

parent 9f5f5457
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"uuid": "6ecd8801-6d57-482c-a715-97b66c59af2d",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "cb9fa4ea-66ca-45af-ad31-e445c7b0ef32",
"uuid": "3c5993f5-983b-4e2a-b0b7-a689f66864bb",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "21fb799a-c7a4-4db2-a442-73df1f94ec5f",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
......
{
"ver": "1.1.2",
"uuid": "0853721c-3f55-4eb2-873d-e3081cfadd4b",
"uuid": "f3ffe486-6b9b-4e22-bde5-66705d019409",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "20185448-a1ca-4de2-8b37-7bf6cdfccbae",
"uuid": "e19eae17-18c1-41c2-898d-14a7070dd5e1",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1",
"uuid": "38d8acfa-b55b-47e9-85ad-472fc43a27cb",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "013bd6df-3d03-41c1-9a89-e5911eb73164",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e8bd16b0-3804-45a9-a8ca-f52c02224f55",
"uuid": "13cab73a-b495-4103-b652-9a07c777cc54",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"uuid": "fdbce9c4-0f55-4ac6-9e7f-08a074487b94",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
......
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() {
}
@property(cc.Node)
page1: cc.Node = null;
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.toPage1();
}
initListener() {
this.node.on('page1_btn_click', (event) => {
event.stopPropagation();
let data = event.getUserData();
console.log(data);
alert("点击了" + JSON.stringify(data));
});
}
toPage1(testData = null) {
testData = { left: this.data.left, right: this.data.right };
this.page1.active = true;
this.page1.getComponent('page1').setData(testData)
}
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);
});
})
}
}
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"uuid": "7f21f239-9cae-49dd-83bc-19e54fff6e30",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
// 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
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
private list: Array<{ img, name, id }>;
//TODO:入口方法
public setData(val) {
this.list = [val.left, val.right];
this.initView();
}
//TODO:点击事件
public onTouchItem(e) {
let data = e.target.data;
console.log(data);
let event = new cc.Event.EventCustom('page1_btn_click', true);
event.setUserData(data);
this.node.dispatchEvent(event);
}
private layout: cc.Node;
onLoad() {
this.layout = this.node.getChildByName("layout");
}
initView() {
let children = this.layout.children;
this.list.forEach((data, index) => {
let item = children[index];
this.updateItem(item, data);
})
}
updateItem(item: any, data) {
item.active = true;
item.data = data;
let icon = item.getChildByName("icon")
let bg = item.getChildByName("bg")
let title = item.getChildByName("title")
this.setNetImg(icon, data.img, { w: 320, h: 370 })
title.getComponent(cc.Label).string = data.name;
item.on(cc.Node.EventType.TOUCH_END, this.onTouchItem, this);
}
setNetImg(item, url, { w, h }) {
return new Promise((resolve, reject) => {
if (!item) return console.log("图片更换失败,传入了错误的item");
let node = item.node ? item.node : item;
if (!url) {
if (node) node.active = false;
return console.log("图片更换失败,传入了错误的res");
}
if (!node) return console.log("图片更换失败,传入了错误的item");
if (node.net_url == url) return;
node.active = false;//
cc.loader.load({ url }, (err, texture) => {
if (err && !texture) return;
if (!cc.isValid(node)) return console.log("节点已销毁");
let nw = node.width = texture.width;
let nh = node.height = texture.height;
let component = node.getComponent(cc.Sprite);
let spriteFrame = new cc.SpriteFrame(texture);
component.spriteFrame = spriteFrame;
node.net_url = url;
if (!cc.isValid(node)) return console.log("节点已销毁");
if (!node) return console.log("节点已销毁");
if (w && h) {
let scaleX = w / nw;
let scaleY = h / nh;
let scale = scaleX <= scaleY ? scaleX : scaleY;
node.width = nw * scale;
node.height = nh * scale;
}
node.active = true;
resolve({ w: nw, h: nh });
});
})
}
}
{
"ver": "1.0.8",
"uuid": "d4bad021-d48b-4720-b94c-a6f01f0af8cf",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "b0c008bc-cf92-463b-8360-0984e13c2e4d",
"uuid": "5cd4fa87-3365-4a87-a8c0-202216a661e7",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29",
"uuid": "119da46d-6e2b-465f-bbc2-9f77798143e4",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
// 新剧本地图页
export const defaultData = {
//左右两个
left: {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记',
id: 1234,
},
right: {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '大红帽历险记',
id: 1235,
},
//固定3个
eventList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记',
totalIcon: 0,
locked: false,
id: 1234,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '中红帽历险记',
totalIcon: 100,
locked: false,
id: 1235,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '大红帽历险记',
totalIcon: 100,
locked: true,
id: 1236,
}],
//游戏列表
gameList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记1',
locked: false,
id: 1231,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记2',
locked: false,
id: 1232,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记3',
locked: false,
id: 1233,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记4',
locked: false,
id: 1234,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记5',
locked: false,
id: 1235,
}],
}
{
"ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5",
"uuid": "92402a45-5d05-4a21-8128-c239310c8c40",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "b54300af-b8e5-4b4e-aa2f-9ac1cef7b598",
"uuid": "52dab298-199d-4d7d-a3ba-bdbd87bb6fa1",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353",
"uuid": "97f5da91-7ee0-4675-82c4-c047f70d0327",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "8ba21262-178f-4fa5-afc9-2c1dd50ba3ab",
"uuid": "05c2a7fa-9c38-45ba-8baa-5bbfcc83b51c",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "85ca8f49-e6bf-4642-81a3-db8498f3ea9c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"1orange": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "a453e479-e016-46cb-992a-0d4c4b6b65c8",
"rawTextureUuid": "85ca8f49-e6bf-4642-81a3-db8498f3ea9c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "1.1.2",
"uuid": "9cbef285-75ee-408a-bc76-ebf5a4f53e08",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "488561c4-f534-4a6c-a3a5-c09ea8e9d890",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"1": {
"ver": "1.0.4",
"uuid": "9e617a17-0455-4948-8fc9-772ecbce5286",
"rawTextureUuid": "488561c4-f534-4a6c-a3a5-c09ea8e9d890",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f8e026f8-a5c6-4315-8eef-0cb3997082bf",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"2": {
"ver": "1.0.4",
"uuid": "f0a5231e-1c19-49e6-86ab-ac6fa8fd3e18",
"rawTextureUuid": "f8e026f8-a5c6-4315-8eef-0cb3997082bf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "11214774-2987-4754-aea4-113fb980b577",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"3": {
"ver": "1.0.4",
"uuid": "e5c82fc4-0f9b-4b1f-ba61-5e74d35b7128",
"rawTextureUuid": "11214774-2987-4754-aea4-113fb980b577",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "05e8a140-2a66-481a-8a85-659bf3c46e29",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "82d69450-e703-4b4d-98f3-e881e6c3b708",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "a2f55843-b598-4c4d-9766-6a455ebb766c",
"rawTextureUuid": "82d69450-e703-4b4d-98f3-e881e6c3b708",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2b825022-ffd0-43ef-9247-4ee771f41373",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 415,
"height": 477,
"platformSettings": {},
"subMetas": {
"bg_di1": {
"ver": "1.0.4",
"uuid": "a567032b-3f3a-41ad-8c14-5b2e20a5c9b1",
"rawTextureUuid": "2b825022-ffd0-43ef-9247-4ee771f41373",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 415,
"height": 477,
"rawWidth": 415,
"rawHeight": 477,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4f67849e-7b3f-424e-a6f0-a4e7192da817",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 135,
"platformSettings": {},
"subMetas": {
"bg_earth": {
"ver": "1.0.4",
"uuid": "eb483a6f-10ac-40f1-a405-6dff6ee58c1c",
"rawTextureUuid": "4f67849e-7b3f-424e-a6f0-a4e7192da817",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 135,
"rawWidth": 1334,
"rawHeight": 135,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "46c3026e-a33b-46d0-8e99-395d9492e1c1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c7813353-34b9-4900-94fc-a63be461afc3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "0efa0c2c-91b5-4c72-ba40-a87edff16a9d",
"rawTextureUuid": "c7813353-34b9-4900-94fc-a63be461afc3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f454bcfb-66a6-4f87-8783-c93c29c6d310",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 365,
"height": 534,
"platformSettings": {},
"subMetas": {
"bg_di2-nostone": {
"ver": "1.0.4",
"uuid": "a4bc3a05-a549-49e0-a723-ab269f7682c2",
"rawTextureUuid": "f454bcfb-66a6-4f87-8783-c93c29c6d310",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -31.5,
"trimX": 0,
"trimY": 63,
"width": 365,
"height": 471,
"rawWidth": 365,
"rawHeight": 534,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7dc2ec63-02c1-43af-ac09-3ac5981e8090",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 365,
"height": 534,
"platformSettings": {},
"subMetas": {
"bg_di2": {
"ver": "1.0.4",
"uuid": "6a47c923-4440-4f06-a95b-c97341681918",
"rawTextureUuid": "7dc2ec63-02c1-43af-ac09-3ac5981e8090",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 365,
"height": 534,
"rawWidth": 365,
"rawHeight": 534,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "521a3ef7-a91c-40ac-b552-0a3759894950",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 685,
"platformSettings": {},
"subMetas": {
"bg_grass": {
"ver": "1.0.4",
"uuid": "8e0ca6d2-079f-472e-96af-e074b892759c",
"rawTextureUuid": "521a3ef7-a91c-40ac-b552-0a3759894950",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 685,
"rawWidth": 1334,
"rawHeight": 685,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "285bcf6b-6286-4bdb-9d0c-b817ef1d1131",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 318,
"height": 143,
"platformSettings": {},
"subMetas": {
"bg_left": {
"ver": "1.0.4",
"uuid": "afd7560e-e4f3-49fc-a670-37a78dfb9573",
"rawTextureUuid": "285bcf6b-6286-4bdb-9d0c-b817ef1d1131",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 318,
"height": 143,
"rawWidth": 318,
"rawHeight": 143,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5b77acf4-30a7-40af-afe9-af9bf58e950b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 304,
"height": 119,
"platformSettings": {},
"subMetas": {
"bg_right": {
"ver": "1.0.4",
"uuid": "b66158a1-4f87-4375-bfac-dd434e653441",
"rawTextureUuid": "5b77acf4-30a7-40af-afe9-af9bf58e950b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 304,
"height": 119,
"rawWidth": 304,
"rawHeight": 119,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "003a4438-e257-4e9a-8a6e-147c75720fc3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 72,
"height": 75,
"platformSettings": {},
"subMetas": {
"icon_key": {
"ver": "1.0.4",
"uuid": "6ecbfa29-a70e-470e-a3c7-52134cdc93b5",
"rawTextureUuid": "003a4438-e257-4e9a-8a6e-147c75720fc3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 72,
"height": 75,
"rawWidth": 72,
"rawHeight": 75,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "91c00c7a-c4df-4b9b-9e83-36005ecc89dc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_huigu": {
"ver": "1.0.4",
"uuid": "f22880b6-aaef-4415-b574-daafaa069b5e",
"rawTextureUuid": "91c00c7a-c4df-4b9b-9e83-36005ecc89dc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 134,
"height": 36,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2e7bb36e-6ab7-4fbd-b825-92fb5694222f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_tiyan": {
"ver": "1.0.4",
"uuid": "3b2a64f1-7915-4bd3-bfba-376885a84acc",
"rawTextureUuid": "2e7bb36e-6ab7-4fbd-b825-92fb5694222f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 134,
"height": 36,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a425d4a6-13aa-4180-a159-e99e15026366",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 134,
"height": 37,
"platformSettings": {},
"subMetas": {
"text_yugao": {
"ver": "1.0.4",
"uuid": "2427c721-32ee-42c1-accb-26de716feb5e",
"rawTextureUuid": "a425d4a6-13aa-4180-a159-e99e15026366",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 1,
"trimY": 0,
"width": 133,
"height": 37,
"rawWidth": 134,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "b93d8200-de55-4e63-bfb1-463f1bf6a975",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8f22eaa2-4fe4-4469-a7b2-c960d0ff83e0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"bg_bg3": {
"ver": "1.0.4",
"uuid": "2bf1fb86-36cf-407c-91b8-cc8279c993d4",
"rawTextureUuid": "8f22eaa2-4fe4-4469-a7b2-c960d0ff83e0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3762e54a-3a48-4d66-bf6b-90f084a13cd0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-blue": {
"ver": "1.0.4",
"uuid": "51989226-b1cf-4933-8625-164058d7f424",
"rawTextureUuid": "3762e54a-3a48-4d66-bf6b-90f084a13cd0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "edb0880b-1ad2-40ca-9411-c645b4bfc870",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-green": {
"ver": "1.0.4",
"uuid": "878af262-4ed3-4c0b-9ee4-6a08d04d0f28",
"rawTextureUuid": "edb0880b-1ad2-40ca-9411-c645b4bfc870",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6ad9ee9f-6678-404c-9c60-24564b11c635",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 429,
"height": 385,
"platformSettings": {},
"subMetas": {
"bg_di3-yellow": {
"ver": "1.0.4",
"uuid": "80eca936-3223-458d-a274-b5d35788eaed",
"rawTextureUuid": "6ad9ee9f-6678-404c-9c60-24564b11c635",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 429,
"height": 385,
"rawWidth": 429,
"rawHeight": 385,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "02cd604d-aa4c-4f73-a118-b2ed82c2c533",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 166,
"platformSettings": {},
"subMetas": {
"bg_front": {
"ver": "1.0.4",
"uuid": "ef1d5375-3326-441e-b619-ed0482042243",
"rawTextureUuid": "02cd604d-aa4c-4f73-a118-b2ed82c2c533",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 166,
"rawWidth": 1334,
"rawHeight": 166,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "e7308004-b17c-4f3b-a380-026a9988b03f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "2e238cb3-d917-4a6f-ac1b-13988d2592cb",
"rawTextureUuid": "e7308004-b17c-4f3b-a380-026a9988b03f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "31127930-85f7-44b0-aee2-58c642a8e599",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"btn_left": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "b15cda9b-0bd1-465a-b1df-d0e45d6f528d",
"rawTextureUuid": "31127930-85f7-44b0-aee2-58c642a8e599",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "04000049-f34f-4b98-8255-c7369c9faeca",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"btn_right": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "1a98ba74-ccc6-47f7-a0c1-12382a550666",
"rawTextureUuid": "04000049-f34f-4b98-8255-c7369c9faeca",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "f0421859-af67-4479-9668-a825e2fe45e9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "96d8d904-eec0-46e3-a6a6-536fa7013bde",
"rawTextureUuid": "f0421859-af67-4479-9668-a825e2fe45e9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
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() {
}
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
......@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
}
let creatorBasePath = 'CocosCreator';
let creatorBasePath = 'D:\\work\\CocosDashboard_1.0.9\\resources\\.editors\\Creator\\2.4.5\\CocosCreator.exe';
if (process.platform !== 'win32') {
creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator";
}
......@@ -349,56 +349,56 @@ module.exports = {
// 清理旧文件
// 构建form
await removeDir('dist/form');
await buildForm();
// await removeDir('dist/form');
// await buildForm();
// 替换uuid
await replaceUuids();
// 改设置为非bundle
changeSettingToWebDesktop();
// changeSettingToWebDesktop();
// 构建play
await removeDir('dist/play');
await buildWebDesktop();
await copyDir('build/web-desktop', 'dist/play');
replaceIndexHtml();
console.log('构建 web desktop 成功!');
// // 构建play
// await removeDir('dist/play');
// await buildWebDesktop();
// await copyDir('build/web-desktop', 'dist/play');
// replaceIndexHtml();
// console.log('构建 web desktop 成功!');
// 改设置为bundle
changeSettingsToBundle();
// // 改设置为bundle
// changeSettingsToBundle();
await removeDir('dist/android');
await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android');
console.log('构建 android bundle 成功!');
// await removeDir('dist/android');
// await buildAndroidBundle();
// await copyDir('build_android/jsb-link/remote', 'dist/android');
// console.log('构建 android bundle 成功!');
await removeDir('dist/ios');
await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios');
console.log('构建 ios bundle 成功!');
// await removeDir('dist/ios');
// await buildIosBundle();
// await copyDir('build_ios/jsb-link/remote', 'dist/ios');
// console.log('构建 ios bundle 成功!');
await removeDir('dist/web_desktop');
await buildWebBundle();
await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
console.log('构建 web bundle 成功!');
// await removeDir('dist/web_desktop');
// await buildWebBundle();
// await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
// console.log('构建 web bundle 成功!');
// 改设置为非bundle
changeSettingToWebDesktop();
// // 改设置为非bundle
// changeSettingToWebDesktop();
createConfigFile(projectName);
// createConfigFile(projectName);
compressAll(projectName);
// compressAll(projectName);
await removeDir('build');
await removeDir('build_android');
await removeDir('build_ios');
await removeDir('build_web_desktop');
// await removeDir('build');
// await removeDir('build_android');
// await removeDir('build_ios');
// await removeDir('build_web_desktop');
const endTime = new Date().getTime();
const duration = new Date(endTime - startTime);
console.log(`打包完成!`);
console.log(`用时${duration.getMinutes()}${duration.getSeconds()}秒。`);
// const endTime = new Date().getTime();
// const duration = new Date(endTime - startTime);
// console.log(`打包完成!`);
// console.log(`用时${duration.getMinutes()}分${duration.getSeconds()}秒。`);
},
buildAndroid: async function () {
......
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"startScene": "fdbce9c4-0f55-4ac6-9e7f-08a074487b94",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment