Commit d8a4405d authored by 李维's avatar 李维

去掉提示小手

parent a3f5ba9f
No preview for this file type
...@@ -57,25 +57,10 @@ npm start ...@@ -57,25 +57,10 @@ npm start
* 下载模板调试专用app * 下载模板调试专用app
安卓下载:
http://download-iplayabc.oss-cn-beijing.aliyuncs.com/iDebugABC.apk http://download-iplayabc.oss-cn-beijing.aliyuncs.com/iDebugABC.apk
![avatar](http://staging-teach.cdn.ireadabc.com/084f2f95-8213-4c5a-8c46-b194819d7677.png) ![avatar](http://staging-teach.cdn.ireadabc.com/084f2f95-8213-4c5a-8c46-b194819d7677.png)
iOS下载:
由于调试APP没有上架App Store 所以需要先获取手机的UDID 发送给我们的技术支持,加入后才可以扫码下载安装
获取UDID:https://www.pgyer.com/tools/udid
下载iOS: https://www.pgyer.com/gS0X
有时可能需要反复调试一些功能性的问题,与原生APP相关或者手上临时没有设备,我们提供了一个网页版的调试方式
http://staging-openapi.iteachabc.com/api/courseware/v1/middle/debug
* 启动本地服务 * 启动本地服务
``` ```
...@@ -90,6 +75,5 @@ npm start ...@@ -90,6 +75,5 @@ npm start
### 注意事项及常见问题 ### 注意事项及常见问题
* 项目里所有文件及文件夹的命名方式要注意不能包含空格、汉字、减号 * 项目里所有文件及文件夹的命名方式要注意不能包含空格、汉字、减号
* 开发者新建的脚本文件(.js/.ts)的文件名必须包含项目名称,例如在 test_01 项目中添加一个脚本文件(如想命名为 hello.ts );则需要命名为 hello_test_01.ts
* 项目里尽量不要使用setTimeout、setInterval等定时器,如果使用了记得在onDestroy中释放掉(onDestroy 是指CocosCreator的生命周期钩子) * 项目里尽量不要使用setTimeout、setInterval等定时器,如果使用了记得在onDestroy中释放掉(onDestroy 是指CocosCreator的生命周期钩子)
* 理论上禁止使用全局变量,因为模板到线上会进行组装,常见问题是一个模板使用多次造成全局变量被读脏 * 理论上禁止使用全局变量,因为模板到线上会进行组装,常见问题是一个模板使用多次造成全局变量被读脏
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541", "uuid": "e4e63278-7d5c-4471-9108-a1307c915c30",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "cb9fa4ea-66ca-45af-ad31-e445c7b0ef32", "uuid": "df250ae2-615a-44e4-a1a9-ef4d5e0ffb31",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "c59c372c-77b4-4260-b37d-6b7c21033de9",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 0.130612,
"subMetas": {} "subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "bcb11abf-2adb-4cac-a1ed-f9efd7625ab9",
"downloadMode": 0,
"duration": 1.436735,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "0853721c-3f55-4eb2-873d-e3081cfadd4b", "uuid": "1de8fc5a-b9cb-47cb-85cd-aa2fa796c39b",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{"name":"hand","version":"5.5","armature":[{"name":"Armature","ik":[],"bone":[{"name":"root","transform":{}},{"name":"组_2","transform":{"x":256.5,"y":15},"parent":"root"}],"aabb":{"x":-330.5,"height":223,"y":-104,"width":665.5},"defaultActions":[{"gotoAndPlay":"hand"}],"animation":[{"name":"hand","frame":[],"bone":[{"name":"root","rotateFrame":[],"translateFrame":[],"scaleFrame":[]},{"name":"组_2","rotateFrame":[],"translateFrame":[{"tweenEasing":0,"y":56,"duration":10},{"tweenEasing":0,"duration":6},{"tweenEasing":0,"duration":18},{"x":-466.5,"duration":0}],"scaleFrame":[]}],"playTimes":0,"ffd":[],"slot":[{"name":"圆角矩形_2","displayFrame":[{"duration":12,"value":-1},{"duration":22}],"colorFrame":[]},{"name":"组_2","displayFrame":[],"colorFrame":[]}],"ik":[],"duration":34}],"slot":[{"name":"圆角矩形_2","color":{},"parent":"root"},{"name":"组_2","color":{},"z":1,"parent":"组_2"}],"skin":[{"name":"","slot":[{"name":"组_2","display":[{"name":"手势/组_2","transform":{"x":-5.5,"skY":-0.1219,"y":-7.5,"skX":-0.1219},"type":"image","path":"手势/组_2"}]},{"name":"圆角矩形_2","display":[{"name":"手势/圆角矩形_2","transform":{"x":-24,"skY":-0.1219,"y":-80.5,"skX":-0.1219},"type":"image","path":"手势/圆角矩形_2"}]}]}],"frameRate":24,"type":"Armature"}],"frameRate":24,"isGlobal":0}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "cd105062-c428-439c-82bb-77710db4bc5b",
"subMetas": {}
}
\ No newline at end of file
{"name":"hand","imagePath":"hand_tex.png","SubTexture":[{"name":"手势/圆角矩形_2","x":171,"height":32,"y":1,"width":613},{"name":"手势/组_2","x":1,"height":223,"y":1,"width":168}],"height":256,"width":1024}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "453e22d7-698b-4214-92cb-5decdc644730",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f9cb5c6d-2272-435f-9d69-5c77c0d4659e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 256,
"platformSettings": {},
"subMetas": {
"hand_tex": {
"ver": "1.0.4",
"uuid": "975b6a3a-d8b9-4a67-9a3e-a18c1aae8fc5",
"rawTextureUuid": "f9cb5c6d-2272-435f-9d69-5c77c0d4659e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -119.5,
"offsetY": 15.5,
"trimX": 1,
"trimY": 1,
"width": 783,
"height": 223,
"rawWidth": 1024,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "20185448-a1ca-4de2-8b37-7bf6cdfccbae", "uuid": "c5d01bde-d8b6-409d-8d0d-fbba33a46584",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1", "uuid": "db152161-d6f4-4b0e-8c0f-4fb0d8ead732",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "e8bd16b0-3804-45a9-a8ca-f52c02224f55", "uuid": "aa410db6-3454-4766-9453-655026747367",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
// export class Option {
// type;
// txt;
// picUrl;
// audioUrl;
// public data;
// public id: number;
// public count: number;
// constructor(data, id) {
// this.id = id;
// this.data = data;
// this.type = data.type;
// this.txt = data.text;
// this.picUrl = data.image;
// this.audioUrl = data.optionAudio;
// }
// }
export class Item {
public page;
public audio;
public image;
public text;
public type;
public recordScore;
public recordAudio;
constructor(data, page) {
this.audio = data.audio;
this.image = data.image;
this.text = data.text;
this.type = data.type;
this.recordScore = -1;
this.page = page;
}
}
export default class Game {
private static ins: Game;
public static getIns(): Game {
if (!Game.ins) Game.ins = new Game();
return Game.ins;
}
private data: any;
public lists: Array<Item>
public isRead: boolean;//record 录音模式 read 阅读模式
constructor() {
//
this.start = false;
this.lists = [];
}
get len() {
return this.lists.length;
}
public init(data) {
this.start = false;
this.lists = [];
this.data = data.questions;
this.isRead = data.questionType == "read";
}
public start: boolean;
public page: number;
reset() {
this.page = 1;
this.start = true;
this.lists = [];
for (let i = 0; i < this.data.length; i++) {
let data = this.data[i];
this.lists.push(new Item(data, i));
}
}
getDataByPage(page): Item {
return this.lists.filter(li => li.page == page)[0]
}
getCurrentPage(): Item {
let page = this.page;
return this.lists.filter(li => li.page == page)[0]
}
getTotalPageNum() {
return this.lists.length;
}
getCurrentPageNum() {
return this.page;
}
addPage() {
if (this.page >= this.lists.length) {
return false;
} else {
this.page += 1;
return true
}
}
subPage() {
if (this.page <= 1) {
return false;
} else {
this.page -= 1;
return true
}
}
get isOver() {
return this.page > this.lists.length;
}
}
let win: any = window;
win.Game = Game;
\ No newline at end of file
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5", "uuid": "7a67d801-9190-496a-a830-14505c223942",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
This diff is collapsed.
{ {
"ver": "1.2.9", "ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "uuid": "bce5b988-3d21-43d0-88a5-7210800bf20a",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": false,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "5e9f9da9-ef12-44f0-bd58-de18e05c712b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "56af21e1-80ba-4d5d-88ad-fdccdd5ed484",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "b0c008bc-cf92-463b-8360-0984e13c2e4d", "uuid": "8e490ccb-f4ef-4ee2-998c-56f838b3d440",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
...@@ -87,20 +87,19 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -87,20 +87,19 @@ export class MyCocosSceneComponent extends cc.Component {
preload() { preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList); const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.preloadAny(preloadArr, null, null, async (err, data) => { cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
// if (window && window["air"]) {
if (window && window["air"]) { // // window["air"].onCourseInScreen = (next) => {
// window["air"].onCourseInScreen = (next) => { // // window["air"].isCourseInScreen = true;
// window["air"].isCourseInScreen = true; // // this.onLoadEnd();
// this.onLoadEnd(); // // next();
// next(); // // };
// }; // this.onLoadEnd();
await this.onLoadEnd(); // window["air"].hideAirClassLoading();
window["air"].hideAirClassLoading(); // } else {
} else { // this.onLoadEnd();
await this.onLoadEnd(); // }
} this.onLoadEnd();
cc.debug.setDisplayStats(false); cc.debug.setDisplayStats(false);
}); });
} }
...@@ -110,11 +109,11 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -110,11 +109,11 @@ export class MyCocosSceneComponent extends cc.Component {
if(node){ if(node){
node.getComponent('middleLayer').log(str); node.getComponent('middleLayer').log(str);
}else{ }else{
console.log(str); cc.log(str);
} }
} }
async onLoadEnd() { onLoadEnd() {
} }
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29", "uuid": "7d87bd8c-0f83-4c35-b18c-e4a04bdd3521",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
This diff is collapsed.
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5", "uuid": "071de07f-2459-4e30-b9bc-af34a7fdb7b4",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "b54300af-b8e5-4b4e-aa2f-9ac1cef7b598", "uuid": "a7ad9c2c-144e-4c67-b960-c958f5532b93",
"isPlugin": true, "isPlugin": true,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
...@@ -71,64 +71,64 @@ export function setSprNodeMaxLen(sprNode, maxW, maxH) { ...@@ -71,64 +71,64 @@ export function setSprNodeMaxLen(sprNode, maxW, maxH) {
} }
export function localPosTolocalPos(baseNode, targetNode) { export function localPosTolocalPos(baseNode, targetNode) {
const worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)); const worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y));
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y)); const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos; return localPos;
} }
export function worldPosToLocalPos(worldPos, baseNode) { export function worldPosToLocalPos(worldPos, baseNode) {
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y)); const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos; return localPos;
} }
export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) { export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) {
const worldRect1 = targetNode.getBoundingBoxToWorld(); const worldRect1 = targetNode.getBoundingBoxToWorld();
const worldRect2 = baseNode.getBoundingBoxToWorld(); const worldRect2 = baseNode.getBoundingBoxToWorld();
const sx = worldRect1.width / worldRect2.width; const sx = worldRect1.width / worldRect2.width;
const sy = worldRect1.height / worldRect2.height; const sy = worldRect1.height / worldRect2.height;
if (maxFlag) { if (maxFlag) {
return Math.max(sx, sy); return Math.max(sx, sy);
} else { } else {
return Math.min(sx, sy); return Math.min(sx, sy);
} }
} }
export function getDistance (start, end){ export function getDistance(start, end) {
var pos = cc.v2(start.x - end.x, start.y - end.y); var pos = cc.v2(start.x - end.x, start.y - end.y);
var dis = Math.sqrt(pos.x*pos.x + pos.y*pos.y); var dis = Math.sqrt(pos.x * pos.x + pos.y * pos.y);
return dis; return dis;
} }
export function playAudioByUrl(audio_url, cb=null) { export function playAudioByUrl(audio_url, cb = null) {
if (audio_url) { if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => { cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
cb(); cb();
}); });
} }
}); });
} }
} }
export function btnClickAnima(btn, time=0.15, rate=1.05) { export function btnClickAnima(btn, time = 0.15, rate = 1.05) {
btn.tmpScale = btn.scale; btn.tmpScale = btn.scale;
btn.on(cc.Node.EventType.TOUCH_START, () => { btn.on(cc.Node.EventType.TOUCH_START, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.scale * rate}) .to(time / 2, { scale: btn.scale * rate })
.start() .start()
}) })
btn.on(cc.Node.EventType.TOUCH_CANCEL, () => { btn.on(cc.Node.EventType.TOUCH_CANCEL, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.tmpScale}) .to(time / 2, { scale: btn.tmpScale })
.start() .start()
}) })
btn.on(cc.Node.EventType.TOUCH_END, () => { btn.on(cc.Node.EventType.TOUCH_END, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.tmpScale}) .to(time / 2, { scale: btn.tmpScale })
.start() .start()
}) })
} }
...@@ -179,7 +179,7 @@ export async function asyncDelay(time) { ...@@ -179,7 +179,7 @@ export async function asyncDelay(time) {
try { try {
cc.tween(cc.find('Canvas')) cc.tween(cc.find('Canvas'))
.delay(time) .delay(time)
.call(()=>{ .call(() => {
resolve(null); resolve(null);
}) })
.start(); .start();
...@@ -191,69 +191,69 @@ export async function asyncDelay(time) { ...@@ -191,69 +191,69 @@ export async function asyncDelay(time) {
export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJsonDataUrl }, texJsonData: { url: texJsonDataUrl }, texPngData: { url: texPngDataUrl } }) { export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJsonDataUrl }, texJsonData: { url: texJsonDataUrl }, texPngData: { url: texPngDataUrl } }) {
if (!texPngDataUrl || !texJsonDataUrl || !texPngDataUrl if (!texPngDataUrl || !texJsonDataUrl || !texPngDataUrl
|| texPngDataUrl == '' || texJsonDataUrl == '' || texPngDataUrl == '') { || texPngDataUrl == '' || texJsonDataUrl == '' || texPngDataUrl == '') {
return; return;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (node.animaNode) { if (node.animaNode) {
node.animaNode.removeFromParent(); node.animaNode.removeFromParent();
}
const animaNode = new cc.Node();
animaNode.name = 'animaNode';
animaNode.parent = node;
animaNode.active = true;
node.animaNode = animaNode;
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
const loadTexture = new Promise((resolve, reject) => {
cc.assetManager.loadRemote(texPngDataUrl, (error, texture) => {
if (error) {
reject(error);
} }
const animaNode = new cc.Node(); resolve(texture);
animaNode.name = 'animaNode'; });
animaNode.parent = node; });
animaNode.active = true;
node.animaNode = animaNode;
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
const loadTexture = new Promise((resolve, reject) => {
cc.assetManager.loadRemote(texPngDataUrl, (error, texture) => {
if (error) {
reject(error);
}
resolve(texture);
});
});
const loadTexJsonData = new Promise((resolve, reject) => { const loadTexJsonData = new Promise((resolve, reject) => {
cc.assetManager.loadAny({ url: texJsonDataUrl }, (error, atlasJson) => { cc.assetManager.loadAny({ url: texJsonDataUrl }, (error, atlasJson) => {
if (error) { if (error) {
reject(error); reject(error);
} }
resolve(atlasJson); resolve(atlasJson);
}); });
}); });
const loadSkeJsonData = new Promise((resolve, reject) => { const loadSkeJsonData = new Promise((resolve, reject) => {
cc.assetManager.loadAny({ url: skeJsonDataUrl }, (error, dragonBonesJson) => { cc.assetManager.loadAny({ url: skeJsonDataUrl }, (error, dragonBonesJson) => {
if (error) { if (error) {
reject(error); reject(error);
} }
resolve(dragonBonesJson); resolve(dragonBonesJson);
}); });
}); });
Promise.all([loadTexture, loadTexJsonData, loadSkeJsonData]).then(([texture, atlasJson, dragonBonesJson]) => { Promise.all([loadTexture, loadTexJsonData, loadSkeJsonData]).then(([texture, atlasJson, dragonBonesJson]) => {
const atlas = new dragonBones.DragonBonesAtlasAsset(); const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = JSON.stringify(atlasJson); atlas.atlasJson = JSON.stringify(atlasJson);
atlas.texture = texture; atlas.texture = texture;
const asset = new dragonBones.DragonBonesAsset(); const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = JSON.stringify(dragonBonesJson); asset.dragonBonesJson = JSON.stringify(dragonBonesJson);
dragonDisplay.dragonAtlasAsset = atlas; dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset; dragonDisplay.dragonAsset = asset;
let armatureNames = dragonBonesJson.armature.map(data => data.name); let armatureNames = dragonBonesJson.armature.map(data => data.name);
if (armatureNames.length > 0) { if (armatureNames.length > 0) {
dragonDisplay.armatureName = armatureNames[0]; dragonDisplay.armatureName = armatureNames[0];
} }
resolve(animaNode); resolve(animaNode);
});
}); });
});
} }
export class FireworkSettings { export class FireworkSettings {
...@@ -411,65 +411,14 @@ export function showTrebleFirework(baseNode, rabbonList) { ...@@ -411,65 +411,14 @@ export function showTrebleFirework(baseNode, rabbonList) {
showFireworks(right); showFireworks(right);
} }
export function httpHeadCall(requsetUrl: string, callback) { export function onHomeworkFinish(data) {
let xhr = new XMLHttpRequest();
console.log("Status: Send Post Request to " + requsetUrl);
try {
xhr.onreadystatechange = () => {
try {
console.log('xhr.readyState: ', xhr.readyState);
if (xhr.readyState == 4) {
if ((xhr.status >= 200 && xhr.status < 400)) {
callback(true);
} else {
callback(false);
}
}
} catch (e) {
console.log(e)
}
};
xhr.open("HEAD", requsetUrl, true);
xhr.send();
xhr.timeout = 15000;
xhr.onerror = (e) => {
callback(false);
};
xhr.ontimeout = (e) => {
callback(false);
};
} catch (e) {
console.log("Send Get Request error: ", e);
}
}
export function onHomeworkFinish(data = "", callback = ()=>{}) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.onHomeworkFinish(callback, data);
} else {
console.log('onHomeworkFinish', JSON.stringify(data));
}
}
export function callMiddleLayerFunction(apiName: string, data: any, callback: Function) {
const middleLayer = cc.find('middleLayer'); const middleLayer = cc.find('middleLayer');
if (middleLayer) { if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer'); const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.callMiddleLayerFunction(apiName, data, callback); // if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
// }
} else { } else {
console.log('callMiddleLayerFunction: ' + apiName); console.log('onHomeworkFinish');
} }
} }
\ No newline at end of file
export function showTips(tips) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
middleLayer.getComponent('middleLayer').showTips(tips);
} else {
console.log(tips);
}
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353", "uuid": "d090f9ae-1459-4a04-8035-a861350ab7fa",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "8ba21262-178f-4fa5-afc9-2c1dd50ba3ab", "uuid": "cb377a3b-c4d2-4ec3-9431-4ef4c7c2112e",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{
"ver": "2.3.5",
"uuid": "529c52b7-6716-4b33-8c3f-20622e7715d1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2560,
"height": 1440,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "964ed8e6-0be4-48b9-b663-218006de8454",
"rawTextureUuid": "529c52b7-6716-4b33-8c3f-20622e7715d1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2560,
"height": 1440,
"rawWidth": 2560,
"rawHeight": 1440,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "72835f10-2305-419d-a20b-04de20460a0d",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 394,
"height": 67, "height": 137,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "bg_excellent-small": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "78d0c330-2659-408c-8982-97669e8f244e",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "72835f10-2305-419d-a20b-04de20460a0d",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": -0.5, "offsetX": -3,
"offsetY": 0.5, "offsetY": 0.5,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 60, "width": 388,
"height": 66, "height": 136,
"rawWidth": 61, "rawWidth": 394,
"rawHeight": 67, "rawHeight": 137,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "36bd56d3-5070-43cf-85dc-c69c57c1a110",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1441,
"height": 514,
"platformSettings": {},
"subMetas": {
"bg_excellent": {
"ver": "1.0.4",
"uuid": "edb2c26b-4450-44f1-8fdc-10e83e2e6918",
"rawTextureUuid": "36bd56d3-5070-43cf-85dc-c69c57c1a110",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -12.5,
"offsetY": -4,
"trimX": 4,
"trimY": 13,
"width": 1408,
"height": 496,
"rawWidth": 1441,
"rawHeight": 514,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "80b4206a-889e-46a1-a01e-4913f30d533b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 394,
"height": 137,
"platformSettings": {},
"subMetas": {
"bg_good-small": {
"ver": "1.0.4",
"uuid": "8b3cf551-5a21-49f4-8933-7006647a7ca8",
"rawTextureUuid": "80b4206a-889e-46a1-a01e-4913f30d533b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3,
"offsetY": -11,
"trimX": 0,
"trimY": 23,
"width": 388,
"height": 113,
"rawWidth": 394,
"rawHeight": 137,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "32117412-1d38-407f-a160-0cbe84f0b7e9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1441,
"height": 514,
"platformSettings": {},
"subMetas": {
"bg_good": {
"ver": "1.0.4",
"uuid": "23c20049-0059-4ef7-8e9d-4024aadf3647",
"rawTextureUuid": "32117412-1d38-407f-a160-0cbe84f0b7e9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -12.5,
"offsetY": -46.5,
"trimX": 4,
"trimY": 98,
"width": 1408,
"height": 411,
"rawWidth": 1441,
"rawHeight": 514,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "d5b80fc2-e965-4490-99b3-431c82452523",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 366, "width": 341,
"height": 336, "height": 140,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "bg_number": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "f9920240-3292-4e24-af19-c4066221d56e",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "d5b80fc2-e965-4490-99b3-431c82452523",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 1, "trimY": 0,
"width": 366, "width": 341,
"height": 335, "height": 140,
"rawWidth": 366, "rawWidth": 341,
"rawHeight": 336, "rawHeight": 140,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "7ea9abd4-8f53-4e03-b5d1-99d8ea6c1ad5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 394,
"height": 137,
"platformSettings": {},
"subMetas": {
"bg_tryagain-small": {
"ver": "1.0.4",
"uuid": "b8490407-4e98-4c70-802c-239e13e6e705",
"rawTextureUuid": "7ea9abd4-8f53-4e03-b5d1-99d8ea6c1ad5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 2,
"offsetY": -12,
"trimX": 4,
"trimY": 24,
"width": 390,
"height": 113,
"rawWidth": 394,
"rawHeight": 137,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b8822e20-c769-45e5-afa2-74a7fad8429b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1441,
"height": 514,
"platformSettings": {},
"subMetas": {
"bg_tryagain": {
"ver": "1.0.4",
"uuid": "6959f464-2e7f-47a5-8358-51cf5dd1f9bf",
"rawTextureUuid": "b8822e20-c769-45e5-afa2-74a7fad8429b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 6,
"offsetY": -46.5,
"trimX": 17,
"trimY": 98,
"width": 1419,
"height": 411,
"rawWidth": 1441,
"rawHeight": 514,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0b40483b-148c-4a5d-88fc-bee336659134",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2361,
"height": 721,
"platformSettings": {},
"subMetas": {
"bg_worddi": {
"ver": "1.0.4",
"uuid": "9243beb9-e02c-4ca9-8551-3bc8546b0f05",
"rawTextureUuid": "0b40483b-148c-4a5d-88fc-bee336659134",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -4,
"offsetY": 4,
"trimX": 4,
"trimY": 4,
"width": 2345,
"height": 705,
"rawWidth": 2361,
"rawHeight": 721,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0ff8486b-2748-4997-abcd-e0fb35376667",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 320,
"height": 132,
"platformSettings": {},
"subMetas": {
"btn_auto-off": {
"ver": "1.0.4",
"uuid": "a33833f8-a008-40e8-8700-d081d78af856",
"rawTextureUuid": "0ff8486b-2748-4997-abcd-e0fb35376667",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 317,
"height": 132,
"rawWidth": 320,
"rawHeight": 132,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a82d1bf9-ace1-4abe-9000-fdc259a88fec",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 320,
"height": 132,
"platformSettings": {},
"subMetas": {
"btn_auto-on": {
"ver": "1.0.4",
"uuid": "a4778e79-7654-4e58-b39d-11de535924c0",
"rawTextureUuid": "a82d1bf9-ace1-4abe-9000-fdc259a88fec",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 7.5,
"offsetY": 0,
"trimX": 15,
"trimY": 0,
"width": 305,
"height": 132,
"rawWidth": 320,
"rawHeight": 132,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "0b0c9204-559e-4598-85a1-08147a71a123",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 207,
"height": 67, "height": 216,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "btn_laba": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "7236c83f-a4c5-4c06-adcb-34f6d4e9a063",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "0b0c9204-559e-4598-85a1-08147a71a123",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 207,
"height": 67, "height": 216,
"rawWidth": 61, "rawWidth": 207,
"rawHeight": 67, "rawHeight": 216,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "uuid": "67e480ff-50a0-4d9e-9623-766a83f56484",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 144, "width": 207,
"height": 144, "height": 216,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon": { "btn_laba1": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a", "uuid": "55ec1bc2-e9ba-45c1-be2c-1127771b7ecc",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1", "rawTextureUuid": "67e480ff-50a0-4d9e-9623-766a83f56484",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 19,
"offsetY": -0.5, "offsetY": -0.5,
"trimX": 3, "trimX": 117,
"trimY": 2, "trimY": 93,
"width": 138, "width": 11,
"height": 141, "height": 31,
"rawWidth": 144, "rawWidth": 207,
"rawHeight": 144, "rawHeight": 216,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "5a38225b-9869-4aac-a88b-a90e9c031bfa",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 207,
"height": 216,
"platformSettings": {},
"subMetas": {
"btn_laba2": {
"ver": "1.0.4",
"uuid": "667f25f0-c34a-4dfe-99e1-883766389815",
"rawTextureUuid": "5a38225b-9869-4aac-a88b-a90e9c031bfa",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 35.5,
"offsetY": -0.5,
"trimX": 133,
"trimY": 89,
"width": 12,
"height": 39,
"rawWidth": 207,
"rawHeight": 216,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b7a275a2-1041-42ac-b320-11f1578f81c8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_record": {
"ver": "1.0.4",
"uuid": "f885d63c-2721-4976-b443-725d99e62879",
"rawTextureUuid": "b7a275a2-1041-42ac-b320-11f1578f81c8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 1,
"trimX": 0,
"trimY": 0,
"width": 207,
"height": 216,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3657f0d3-384f-48f9-8ad7-b2009fcd6c9d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_recording-circle": {
"ver": "1.0.4",
"uuid": "32479b1e-c143-49be-bb42-336121739b22",
"rawTextureUuid": "3657f0d3-384f-48f9-8ad7-b2009fcd6c9d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3.5,
"offsetY": 1.5,
"trimX": 27,
"trimY": 33,
"width": 148,
"height": 149,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "50b01808-ad1b-489f-b534-55d0dfa654ae",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_recording": {
"ver": "1.0.4",
"uuid": "a90947f7-c22e-4f7f-b54e-cfdd9be499dc",
"rawTextureUuid": "50b01808-ad1b-489f-b534-55d0dfa654ae",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -28,
"offsetY": 43,
"trimX": 65,
"trimY": 53,
"width": 23,
"height": 26,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0df393d8-f6b3-4a40-b918-b41ff38e1604",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 207,
"height": 215,
"platformSettings": {},
"subMetas": {
"btn_return": {
"ver": "1.0.4",
"uuid": "96132575-00bd-4010-9194-d65261900e79",
"rawTextureUuid": "0df393d8-f6b3-4a40-b918-b41ff38e1604",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 207,
"height": 215,
"rawWidth": 207,
"rawHeight": 215,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2d6e69e4-1ba3-4489-899b-ac4fa37072d6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_start": {
"ver": "1.0.4",
"uuid": "2a449ba6-3d44-41c1-bceb-8012f82c2824",
"rawTextureUuid": "2d6e69e4-1ba3-4489-899b-ac4fa37072d6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 1,
"trimX": 0,
"trimY": 0,
"width": 207,
"height": 216,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6138136d-66d6-4516-828f-46bd69caeec9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_stop-ban": {
"ver": "1.0.4",
"uuid": "48ed5021-7b64-492b-8c43-d78e6ceddd50",
"rawTextureUuid": "6138136d-66d6-4516-828f-46bd69caeec9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 9,
"offsetY": -13,
"trimX": 20,
"trimY": 28,
"width": 187,
"height": 188,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "05074190-1805-4ab6-aab4-2afad044dff5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 218,
"platformSettings": {},
"subMetas": {
"btn_stop": {
"ver": "1.0.4",
"uuid": "e1fa002c-e978-440b-bbc4-24a2442dadd7",
"rawTextureUuid": "05074190-1805-4ab6-aab4-2afad044dff5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 1,
"trimX": 0,
"trimY": 0,
"width": 207,
"height": 216,
"rawWidth": 209,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "31448091-c7a6-43c5-a39c-e3100c9b1af2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 136,
"height": 136,
"platformSettings": {},
"subMetas": {
"icon_review": {
"ver": "1.0.4",
"uuid": "fe873a35-681e-48f3-b328-64231a013d06",
"rawTextureUuid": "31448091-c7a6-43c5-a39c-e3100c9b1af2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 136,
"height": 136,
"rawWidth": 136,
"rawHeight": 136,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "59997e66-2db1-4d8f-9648-c3d47857bd5b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 230,
"height": 230,
"platformSettings": {},
"subMetas": {
"pages-left": {
"ver": "1.0.4",
"uuid": "94ca30fc-50d9-4be2-91c7-a52cf1e31cf1",
"rawTextureUuid": "59997e66-2db1-4d8f-9648-c3d47857bd5b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 3,
"offsetY": 0,
"trimX": 32,
"trimY": 0,
"width": 172,
"height": 230,
"rawWidth": 230,
"rawHeight": 230,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8f0e97bd-2091-4793-b24f-a78f1ff1a103",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 230,
"height": 230,
"platformSettings": {},
"subMetas": {
"pages-right": {
"ver": "1.0.4",
"uuid": "d74fc167-af18-43e3-a91c-8a4ef22d6eb8",
"rawTextureUuid": "8f0e97bd-2091-4793-b24f-a78f1ff1a103",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 4,
"offsetY": 0,
"trimX": 33,
"trimY": 0,
"width": 172,
"height": 230,
"rawWidth": 230,
"rawHeight": 230,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c1287699-40ca-4dff-8f37-aae1c6714b4d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1000,
"height": 1379,
"platformSettings": {},
"subMetas": {
"shadow": {
"ver": "1.0.4",
"uuid": "5101592c-b9e4-41fe-9689-be166dbc8f6e",
"rawTextureUuid": "c1287699-40ca-4dff-8f37-aae1c6714b4d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -2.5,
"trimX": 20,
"trimY": 51,
"width": 961,
"height": 1282,
"rawWidth": 1000,
"rawHeight": 1379,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "41640532-ab6e-45a1-ae43-7119a6122977",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1000,
"height": 1379,
"platformSettings": {},
"subMetas": {
"shadow1": {
"ver": "1.0.4",
"uuid": "7162e6e1-4de9-4a5d-9dfa-b7e4b11548c6",
"rawTextureUuid": "41640532-ab6e-45a1-ae43-7119a6122977",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 5.5,
"offsetY": -60.5,
"trimX": 30,
"trimY": 167,
"width": 951,
"height": 1166,
"rawWidth": 1000,
"rawHeight": 1379,
"borderTop": 574.5,
"borderBottom": 0,
"borderLeft": 529.5,
"borderRight": 89.5,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3ed4fff8-36b7-408f-8c0a-85284ebc429e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 236,
"height": 38,
"platformSettings": {},
"subMetas": {
"text_review": {
"ver": "1.0.4",
"uuid": "2fcc995c-87dd-4747-a196-2e5c87a30eba",
"rawTextureUuid": "3ed4fff8-36b7-408f-8c0a-85284ebc429e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 236,
"height": 38,
"rawWidth": 236,
"rawHeight": 38,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "573b31ac-de63-4013-a724-059bd89b9fde",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1280, "width": 541,
"height": 720, "height": 122,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "tip_bg": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "21ee246c-ebb5-4e56-b61a-84d9fee38344",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "573b31ac-de63-4013-a724-059bd89b9fde",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 1280, "width": 541,
"height": 720, "height": 122,
"rawWidth": 1280, "rawWidth": 541,
"rawHeight": 720, "rawHeight": 122,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
This diff is collapsed.
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
...@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) { ...@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
} }
let creatorBasePath = 'CocosCreator'; let creatorBasePath = 'D:/CocosDashboard_1.1.1/resources/.editors/Creator/2.4.5/CocosCreator.exe';
if (process.platform !== 'win32') { if (process.platform !== 'win32') {
creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator"; creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator";
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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