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

feat: 初始化

parent d4c5cd1b
No preview for this file type
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);
});
})
}
}
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { defaultData } from "../script/defaultData";
export class MyCocosSceneComponent extends cc.Component {
// 生命周期 onLoad
onLoad() {
this.initSceneData();
this.initSize();
}
_imageResList = null;
_audioResList = null;
_animaResList = null;
initSceneData() {
this._imageResList = [];
this._audioResList = [];
this._animaResList = [];
}
_designSize = null; // 设计分辨率
_frameSize = null; // 屏幕分辨率
_mapScaleMin = null; // 场景中常用缩放(取大值)
_mapScaleMax = null; // 场景中常用缩放(取小值)
_cocosScale = null; // cocos 自缩放 (较少用到)
initSize() {
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height
let design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height
let f = screen_size >= design_size
cc.Canvas.instance.fitHeight = f
cc.Canvas.instance.fitWidth = !f
const frameSize = cc.view.getFrameSize();
this._frameSize = frameSize;
this._designSize = cc.view.getDesignResolutionSize();
let sx = cc.winSize.width / frameSize.width;
let sy = cc.winSize.height / frameSize.height;
this._cocosScale = Math.min(sx, sy);
sx = frameSize.width / this._designSize.width;
sy = frameSize.height / this._designSize.height;
this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
cc.director['_scene'].width = frameSize.width;
cc.director['_scene'].height = frameSize.height;
}
data = null;
// 生命周期 start
start() {
if (window && (<any>window).courseware && (<any>window).courseware.getData) {
(<any>window).courseware.getData((data) => {
this.log('data:' + data);
this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data));
this.preloadItem();
})
} else {
this.data = this.getDefaultData();
this.preloadItem();
}
}
getDefaultData() {
return defaultData;
}
preloadItem() {
this.addPreloadImage();
this.addPreloadAudio();
this.addPreloadAnima();
this.preload();
}
addPreloadImage() {
}
addPreloadAudio() {
}
addPreloadAnima() {
}
preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
if (window && window["air"]) {
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
// this.onLoadEnd();
// next();
// };
this.onLoadEnd();
window["air"].hideAirClassLoading();
} else {
this.onLoadEnd();
}
cc.debug.setDisplayStats(false);
});
}
log (str) {
const node = cc.find('middleLayer');
if(node){
node.getComponent('middleLayer').log(str);
}else{
cc.log(str);
}
}
onLoadEnd() {
}
// ------------------------------------------------
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
getSprNodeByUrl(url, cb) {
const node = new cc.Node();
const spr = node.addComponent(cc.Sprite);
this.getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(node);
}
})
}
playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
});
}else{
cb && cb();
}
}
}
\ No newline at end of file
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.0",
"uuid": "080082e7-5ed1-444f-9be4-602e889e8026",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "60dc3adf-6d9e-4156-a6c7-eb3c9d649b56",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "52bbd6d1-f2d4-426e-9f68-85df81d518a8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "5cb4f4fc-3f4c-45d6-bb0e-9389c8d59409",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "a0c57e07-56ee-496f-8f5b-bbda2bb3e544",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "54f4d342-b8aa-4085-8fe8-1f0af5defd5c",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "04587d3b-d13a-4a1f-b2ed-054eeec32da0",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "195f7a56-8446-4b3c-bb63-fcc7d8d6183d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.SceneAsset",
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"data": {
"__id__": 1
}
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Scene",
"__type__": "cc.Node",
"_name": "ConsoleNode",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 10
},
{
"__id__": 14
},
{
"__id__": 24
},
{
"__id__": 35
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_active": true,
"_components": [
{
"__id__": 46
}
],
"_prefab": {
"__id__": 47
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -30,12 +52,12 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 1280,
"height": 220
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 0.5,
"y": 0
},
"_trs": {
......@@ -43,7 +65,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
-360,
0,
0,
0,
......@@ -54,15 +76,22 @@
1
]
},
"_is3DNode": true,
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_name": "content",
"_objFlags": 0,
"_parent": {
"__id__": 1
......@@ -70,30 +99,20 @@
"_children": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 14
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 24
},
{
"__id__": 25
"__id__": 7
},
{
"__id__": 26
"__id__": 8
}
],
"_prefab": null,
"_prefab": {
"__id__": 9
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -105,7 +124,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"height": 18.9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -116,8 +135,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
0,
15.75,
0,
0,
0,
......@@ -139,11 +158,11 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -153,9 +172,14 @@
"_components": [
{
"__id__": 4
},
{
"__id__": 5
}
],
"_prefab": null,
"_prefab": {
"__id__": 6
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -166,21 +190,21 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 36.7,
"height": 18.9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-627.765,
0,
0,
362.85545494732423,
0,
0,
0,
......@@ -201,71 +225,181 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
"_id": ""
},
{
"__type__": "cc.Camera",
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 15,
"_lineHeight": 15,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": ""
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b78BJTXBxOJowdH7cdXpl9",
"sync": false
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 18.9
},
"_resize": 1,
"_N$layoutType": 2,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": ""
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 40,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 300,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "33BKFzw+NEPZsl8FvGb9J8",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 1
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 6
"__id__": 11
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_prefab": {
"__id__": 13
},
"_opacity": 138,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 81,
"g": 81,
"b": 81,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"height": 220
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -277,7 +411,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
110,
0,
0,
0,
......@@ -299,14 +433,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "32MJMZ2HRGF4BOf533Avyi"
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
"__id__": 10
},
"_enabled": true,
"_materials": [
......@@ -317,10 +451,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd"
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -331,26 +465,76 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "22PwGXpElJA6PT9SKoB+KC",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bottomPart",
"_name": "Console",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 1
},
"_children": [
{
"__id__": 8
"__id__": 15
}
],
"_active": false,
"_components": [
{
"__id__": 19
},
{
"__id__": 11
"__id__": 20
},
{
"__id__": 21
},
{
"__id__": 22
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_prefab": {
"__id__": 23
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -361,20 +545,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 1280,
"height": 220
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
635.132,
-356.326,
0,
0,
0,
0,
0,
......@@ -396,26 +580,28 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8c7k8ep/ZFNpO263+1QHz9"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "btn_left",
"_name": "content",
"_objFlags": 0,
"_parent": {
"__id__": 7
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
"__id__": 16
},
{
"__id__": 10
"__id__": 17
}
],
"_prefab": null,
"_prefab": {
"__id__": 18
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -426,20 +612,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 61,
"height": 67
"width": 0,
"height": 220
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-148.464,
34,
0,
0,
0,
0,
0,
......@@ -461,179 +647,111 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5ad2wLQLxIN5Eg7OHecSH6"
"_id": ""
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5"
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"height": 200
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE"
"_resize": 1,
"_N$layoutType": 2,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": ""
},
{
"__type__": "cc.Button",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 15
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"alignMode": 1,
"_target": null,
"_alignFlags": 40,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
"asset": {
"__id__": 0
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
"fileId": "64iQFZk15EF4xuAmC3UzNk",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "btn_right",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
},
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-47.164,
34,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
"node": {
"__id__": 14
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "46i3stdzpHX6zQHTGnRsNE"
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 300,
"_originalHeight": 31.5,
"_id": ""
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 14
},
"_enabled": true,
"_materials": [
......@@ -641,114 +759,104 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt"
"_segments": 64,
"_N$alphaThreshold": 0.1,
"_N$inverted": false,
"_id": ""
},
{
"__type__": "cc.Button",
"__type__": "cc.ScrollView",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 14
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"horizontal": false,
"vertical": true,
"inertia": false,
"brake": 0.5,
"elastic": false,
"bounceDuration": 1,
"scrollEvents": [],
"cancelInnerEvents": true,
"_N$content": {
"__id__": 15
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
"content": {
"__id__": 15
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
"_id": ""
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"height": 200
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
"_resize": 0,
"_N$layoutType": 2,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 0,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": ""
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu"
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "bdERspRGVBloRV8i0s0jsv",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "res",
"_name": "BtnClose",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 1
},
"_children": [
{
"__id__": 15
},
"__id__": 25
}
],
"_active": false,
"_components": [
{
"__id__": 18
"__id__": 32
},
{
"__id__": 21
"__id__": 33
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_prefab": {
"__id__": 34
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -759,8 +867,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -771,8 +879,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
590,
240,
0,
0,
0,
......@@ -794,23 +902,32 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 14
"__id__": 24
},
"_children": [
{
"__id__": 16
"__id__": 26
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_components": [
{
"__id__": 29
},
{
"__id__": 30
}
],
"_prefab": {
"__id__": 31
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -821,8 +938,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -856,35 +973,37 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9bLfcYeeNKrr524vzWchiM"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 15
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
"__id__": 27
}
],
"_prefab": null,
"_prefab": {
"__id__": 28
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -918,54 +1037,266 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cfMLGsq0BMhJARv+ySMAxS"
"_id": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 26
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_string": "close",
"_N$string": "close",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
"_N$overflow": 1,
"_N$cacheMode": 1,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "3flbaQMblKm4T6Db2uXsFc",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "70qpaNqfFElrp1HhHrNmbZ",
"sync": false
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 25
},
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 0,
"_top": -40,
"_bottom": 243,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 40,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "00vUNqZENF5a9UoUIoXevG",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "img",
"_name": "BtnOpen",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 1
},
"_children": [
{
"__id__": 19
"__id__": 36
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_active": false,
"_components": [
{
"__id__": 43
},
{
"__id__": 44
}
],
"_prefab": {
"__id__": 45
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -976,8 +1307,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -988,8 +1319,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
573.537,
42.637,
0,
0,
0,
......@@ -1011,23 +1342,32 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "53LUHHG2pEr79fyrvazXJs"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 18
"__id__": 35
},
"_children": [],
"_children": [
{
"__id__": 37
}
],
"_active": true,
"_components": [
{
"__id__": 20
"__id__": 40
},
{
"__id__": 41
}
],
"_prefab": null,
"_prefab": {
"__id__": 42
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
......@@ -1038,8 +1378,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 141
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1073,63 +1413,37 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 14
"__id__": 36
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 38
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_prefab": {
"__id__": 39
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1163,121 +1477,219 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d9f+b0lmZGSJJae6zrADhp"
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "btn",
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"_parent": {
"__id__": 21
"node": {
"__id__": 37
},
"_children": [],
"_active": true,
"_components": [
"_enabled": true,
"_materials": [
{
"__id__": 23
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "log",
"_N$string": "log",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 1,
"_N$cacheMode": 1,
"_id": ""
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"asset": {
"__id__": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
"fileId": "69o0bIFURNEYadgopDsNBp",
"sync": false
},
"_eulerAngles": {
"__type__": "cc.Vec3",
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0,
"z": 0
"y": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e87DSaFCVJfb2PAUkf4/o7"
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.AudioSource",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 36
},
"_enabled": true,
"_clip": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "dey05oKrBIspvsDa6pOIQz"
"asset": {
"__id__": 0
},
"fileId": "86lzVsoMxOZ6Lv8r8CrwAM",
"sync": false
},
{
"__type__": "cc.Canvas",
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 35
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_fitWidth": true,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 36
},
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 35
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_alignFlags": 36,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_right": 16.462999999999965,
"_top": 179,
"_bottom": 22.637,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -1287,17 +1699,56 @@
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
"_originalHeight": 40,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "87T5XBFCFG9Y7bLX0mkKzt",
"sync": false
},
{
"__type__": "408a6f4ZfpM8Yzyg+IOGg/V",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 1
},
"_enabled": true,
"_id": "eaTVUpqahPfZeO9+sUI7RP"
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 500,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "a4cbf80d-fd89-477e-a6f9-7ca1bea43179",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"uuid": "a14b1d34-73f9-4c31-8d12-b5ec711a72c1",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
......
cc.Class({
extends: cc.Component,
properties: {},
start() {
// 代码在 ../script/middleLayer.js里
},
});
{
"ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29",
"uuid": "f4ede462-f8d7-4069-ba80-915611c058ca",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
cc.Class({
extends: cc.Component,
properties: {},
getData(callBack) {
const uri = 'courseware/v1/getdata';
let syllabus_id;
if (this.bundleType == 'StoryBox') {
syllabus_id = this.syllabus_id;
} else if (this.bundleType == 'WW') {
syllabus_id = this.bundleInfoList[this.currentBundleIndex].syllabus_id;
}
const data = {
courseid: syllabus_id
};
this.callNetworkApiGet(uri, data, (data) => {
cc.debug.setDisplayStats(false);
callBack(JSON.parse(data.data));
});
},
onHomeworkFinish(callBack) {
if (this.role == 'teacher') {
return;
}
const uri = 'app_source/v1/student/homework/finished';
const data = {
syllabus_id: this.syllabus_id,
homework_id: this.homework_id,
token: this.token,
score: 100
};
console.log('data = ' + JSON.stringify(data));
this.callNetworkApiPost(uri, data, callBack);
},
callNetworkApiGet(uri, data, callBack) {
let queryStr = '';
for (const key in data) {
if (Object.hasOwnProperty.call(data, key)) {
const value = data[key];
if (queryStr == '') {
queryStr += '?';
}
if (queryStr != '?') {
queryStr += '&';
}
queryStr += `${key}=${value}`;
}
}
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
const responseData = JSON.parse(xhr.responseText);
callBack(responseData);
}
};
const url = `${this.baseUrl}${uri}${queryStr}`;
console.log('url = ' + url);
xhr.open('GET', url, true);
xhr.send();
},
callNetworkApiPost(uri, data, callBack) {
const xhr = new XMLHttpRequest();
const url = `${this.baseUrl}${uri}`;
xhr.open("POST", url, true);
xhr.setRequestHeader('content-type', 'application/json');
xhr.onreadystatechange = () => {
if (xhr.readyState == 4) {
callBack(JSON.parse(xhr.responseText));
}
}
xhr.send(JSON.stringify(data));
},
start() {
this.node.zIndex = 9999;
this.showWaitingLetters();
cc.game.addPersistRootNode(this.node);
this.initListener();
this.getBundleInfoList();
// this.baseUrl = 'http://staging-teach.ireadabc.com/api/';
// this.initStoryBoxView({
// // coursewareId: 18307
// // coursewareId: 18582
// coursewareId: 25687
// });
// this.bundleType = 'StoryBox';
this.log('汪汪汪');
},
asyncDelayLog(str) {
console.log(str);
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 1);
});
},
getBundleInfoList() {
const jsonStr = this.callNativeFunction({ name: 'loadSceneList', value: '' });
if (!jsonStr) {
console.error('没有jsonStr!!')
return;
}
const { bundleInfoList, defaultBundleIdx, bundleType, bundleInfo } = JSON.parse(jsonStr);
if (bundleType == 'PetRoom') {
this.bundleType = 'PetRoom';
this.baseUrl = bundleInfo.baseUrl;
this.token = bundleInfo.token;
this.homework_id = bundleInfo.homework_id;
this.syllabus_id = bundleInfo.syllabus_id;
this.role = bundleInfo.role;
this.initPetRoomView(bundleInfo);
} else if (bundleType == "StoryBox") {
this.bundleType = 'StoryBox';
const descLabel = cc.find('middleLayer/storyBox/menu/menuBase/title/name');
descLabel.getComponent(cc.Label).string = bundleInfo.coursewareDescription;
const nameLabel = cc.find('middleLayer/storyBox/menu/menuBase/title/Lession');
nameLabel.getComponent(cc.Label).string = bundleInfo.coursewareName;
this.baseUrl = bundleInfo.baseUrl;
this.initStoryBoxView(bundleInfo);
} else {
this.bundleType = 'WW';
// WW模板
this.bundleInfoList = bundleInfoList;
this.jumpToBundleByIndex(defaultBundleIdx);
}
},
initPetRoomView(bundleInfo) {
this.hideWWView();
this.loadBundle(bundleInfo);
},
initStoryBoxView(bundleInfo) {
this.hideWWView();
// this.showLog(bundleInfo.coursewareId);
this.callNetworkApiGet('syllabus/v1/tree', { orgid: 483, pid: bundleInfo.coursewareId }, (data) => {
console.log(data);
const defaultBondle = data.rows.find(row => row.name == '默认');
if (!defaultBondle) {
cc.find('middleLayer/storyBox/bg').active = true;
console.error('没有默认课件!');
return;
}
cc.find('middleLayer/storyBox/bg').active = false;
this.syllabus_id = defaultBondle.children[0].id;
this.loadBundleByConf(defaultBondle.children[0].conf, () => {
const ExitBtn = cc.find('middleLayer/storyBox/ExitBtn');
ExitBtn.active = true;
});
this.menuItemNodeList = [];
data.rows.filter((row) => {
return row.name != '默认';
}).forEach((data, idx, arr) => {
console.log(data.name, idx);
const node = cc.instantiate(cc.find('middleLayer/menuItem'));
node.name = 'menuItem_' + idx;
node.parent = cc.find('middleLayer/storyBox/menu/menuBase');
node.active = true;
node.x = 0;
node.y = 50 + (arr.length - 1 - idx) * 100;
this.menuItemNodeList.push(node);
const menuBase = cc.find('bubbleBase', node);
const label = cc.find('label', node);
label.getComponent(cc.Label).string = data.name;
label.active = true;
const labelSelected = cc.find('labelSelected', node);
labelSelected.getComponent(cc.Label).string = data.name;
labelSelected.active = false;
const btn = cc.find('btn', node);
const btnLight = cc.find('btnHightLight', node);
const btnSelected = cc.find('btnSelected', node);
btn.active = true;
btnLight.active = false;
btnSelected.active = false;
btn.addComponent(cc.Button);
btn.on('click', () => {
console.log(data);
cc.tween(btn)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.call(() => {
if (data.has_child == '0') {
this.hideAllSubmenu();
this.resetAllMenu();
this.hideMenu();
btn.active = false;
btnSelected.active = true;
label.active = false;
labelSelected.active = true;
if (!data.children[0]) {
cc.find('middleLayer/storyBox/bg').active = true;
console.error('沒有課件!');
return;
}
cc.find('middleLayer/storyBox/bg').active = false;
this.syllabus_id = data.children[0].id;
this.loadBundleByConf(data.children[0].conf);
} else {
this.hideAllSubmenu();
menuBase.active = true;
btn.active = false;
btnLight.active = true;
}
})
.start();
cc.tween(label)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.start();
});
btnLight.addComponent(cc.Button)
btnLight.on('click', () => {
cc.tween(btnLight)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.call(() => {
menuBase.active = false;
btn.active = true;
btnLight.active = false;
})
.start();
cc.tween(label)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.start();
});
btnSelected.addComponent(cc.Button)
btnSelected.on('click', () => {
this.hideMenu();
});
if (data.has_child == '1') {
for (let i = 0; i < 10; i++) {
const optionNode = cc.find(`bubbleBase/bubbleBg/option_${i}`, node);
console.log("optionNode = " + optionNode);
optionNode.active = false;
}
data.children.forEach((menuData, idx) => {
const optionNode = cc.find(`bubbleBase/bubbleBg/option_${idx}`, node);
optionNode.active = true;
const label = cc.find('label', optionNode);
label.getComponent(cc.Label).string = menuData.name;
optionNode.on('click', () => {
cc.tween(optionNode)
.to(0.1, { scale: 1.05 })
.to(0.1, { scale: 1.00 })
.call(() => {
this.hideMenu();
this.syllabus_id = menuData.children[0].id;
this.loadBundleByConf(menuData.children[0].conf);
})
.start();
});
});
}
});
this.storyBoxMenuLength = this.menuItemNodeList.filter(node => node.active).length;
const titleNode = cc.find('middleLayer/storyBox/menu/menuBase/title');
titleNode.y = 30 + this.storyBoxMenuLength * 100;
const storyBox = cc.find('middleLayer/storyBox');
storyBox.active = true;
this.initStoryBoxListener();
});
},
hideAllSubmenu() {
this.menuItemNodeList.forEach(node => {
const menuBase = cc.find('bubbleBase', node);
menuBase.active = false;
});
},
resetAllMenu() {
this.menuItemNodeList.forEach(node => {
const btn = cc.find('btn', node);
const btnLight = cc.find('btnHightLight', node);
const btnSelected = cc.find('btnSelected', node);
btn.active = true;
btnLight.active = false;
btnSelected.active = false;
const label = cc.find('label', node);
const labelSelected = cc.find('labelSelected', node);
label.active = true;
labelSelected.active = false;
});
},
initStoryBoxListener() {
const ExitBtn = cc.find('middleLayer/storyBox/ExitBtn');
ExitBtn.on('click', () => {
cc.tween(ExitBtn)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 })
.to(0.1, { scaleX: 1.1, scaleY: 0.9 })
.to(0.1, { scaleX: 1, scaleY: 1 })
.call(() => {
this.exit();
})
.start();
});
const lineBtnShow = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnShow');
lineBtnShow.on('click', () => {
cc.tween(lineBtnShow)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.call(() => {
this.showMenu();
})
.start();
});
const lineBtnHide = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnHide')
lineBtnHide.on('click', () => {
cc.tween(lineBtnHide)
.to(0.1, { scale: 1.1 })
.to(0.1, { scale: 1.0 })
.call(() => {
this.hideMenu();
})
.start();
});
},
showMenu() {
const lineBtnShow = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnShow');
const lineBtnHide = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnHide')
lineBtnHide.active = true;
lineBtnShow.active = false;
const canvas = cc.find('Canvas');
console.log('canvas.width = ' + canvas.width);
console.log('canvas.height = ' + canvas.height);
const menuBase = cc.find('middleLayer/storyBox/menu/menuBase');
cc.tween(menuBase)
.to(1, { y: this.storyBoxMenuLength * -100 - 80 }, { easing: 'bounceOut' })
.start();
},
hideMenu() {
this.hideAllSubmenu();
this.resetAllMenu();
const lineBtnShow = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnShow');
const lineBtnHide = cc.find('middleLayer/storyBox/menu/menuBase/lineBtnHide')
lineBtnShow.active = true;
lineBtnHide.active = false;
const menuBase = cc.find('middleLayer/storyBox/menu/menuBase');
cc.tween(menuBase)
.to(1, { y: 0 }, { easing: 'cubicInOut' })
.start();
},
hideWWView() {
const exitBtn = cc.find('middleLayer/ExitBtn');
exitBtn.active = false;
const BtnLeft = cc.find('middleLayer/BtnLeft');
BtnLeft.active = false;
const BtnRight = cc.find('middleLayer/BtnRight');
BtnRight.active = false;
},
jumpToBundleByIndex(index) {
this.currentBundleIndex = index;
const currentBundleInfo = this.bundleInfoList[this.currentBundleIndex];
const btnLeft = this.node.getChildByName('BtnLeft');
const btnRight = this.node.getChildByName('BtnRight');
btnLeft.active = true;
btnRight.active = true;
if (this.currentBundleIndex == 0) {
btnLeft.active = false;
}
if (this.currentBundleIndex == this.bundleInfoList.length - 1) {
btnRight.active = false;
}
this.baseUrl = currentBundleInfo.baseUrl;
this.token = currentBundleInfo.token;
this.homework_id = currentBundleInfo.homework_id;
this.syllabus_id = currentBundleInfo.syllabus_id;
this.role = currentBundleInfo.role;
this.loadBundle(currentBundleInfo);
},
loadDefaultBundle() {
const jsonStr = this.callNativeFunction({ name: 'loadScene', value: '' });
const {
sceneName,
version,
bondleUrl,
token,
baseUrl,
homework_id,
syllabus_id,
role
} = JSON.parse(jsonStr);
this.baseUrl = baseUrl;
this.token = token;
this.homework_id = homework_id;
this.syllabus_id = syllabus_id;
this.role = role;
this.loadBundle({ bondleUrl, version, sceneName });
},
initListener() {
const exitBtn = this.node.getChildByName('ExitBtn');
exitBtn.on('click', () => {
cc.tween(exitBtn)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 })
.to(0.1, { scaleX: 1.1, scaleY: 0.9 })
.to(0.1, { scaleX: 1, scaleY: 1 })
.call(() => {
this.exit();
})
.start();
});
const btnLeft = this.node.getChildByName('BtnLeft');
btnLeft.on('click', () => {
if (this.currentBundleIndex - 1 < 0) {
return;
}
this.jumpToBundleByIndex(this.currentBundleIndex - 1);
});
const btnRight = this.node.getChildByName('BtnRight');
btnRight.on('click', () => {
if (this.currentBundleIndex + 1 >= this.bundleInfoList.length) {
return;
}
this.jumpToBundleByIndex(this.currentBundleIndex + 1);
});
const btnClose = cc.find('middleLayer/ConsoleNode/BtnClose');
const btnOpen = cc.find('middleLayer/ConsoleNode/BtnOpen');
const consoleNode = cc.find('middleLayer/ConsoleNode/Console');
const consoleBg = cc.find('middleLayer/ConsoleNode/bg');
btnOpen.on('click', () => {
btnClose.active = true;
btnOpen.active = false;
consoleNode.active = true;
consoleBg.active = true;
});
btnClose.on('click', () => {
btnClose.active = false;
btnOpen.active = true;
consoleNode.active = false;
consoleBg.active = false;
});
},
log(str) {
const logStr = `${new Date().toLocaleString()}: ${str}`;
console.log(logStr);
const content = cc.instantiate(cc.find('middleLayer/ConsoleNode/content'));
content.active = true;
const label = content.getChildByName('label');
label.getComponent(cc.Label).string = logStr;
const consoleContent = cc.find('middleLayer/ConsoleNode/Console/content');
consoleContent.addChild(content);
consoleContent.getComponent(cc.Layout).updateLayout();
},
callNativeFunction(param) {
const paramStr = JSON.stringify(param);
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
return jsb.reflection.callStaticMethod('CocosMng', 'cocosWithNativeProtocol:', paramStr);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
return jsb.reflection.callStaticMethod('com/iplayabc/cocos/AppActivity', 'cocosWithNativeProtocol', '(Ljava/lang/String;)Ljava/lang/String;', paramStr);
} else {
console.error('非源生环境');
}
},
showWaitingLetters() {
const waitingLayer = cc.find('middleLayer/waitingLayer');
waitingLayer.active = true;
const colorList = this.getRainbowColorList();
const layout = cc.find('middleLayer/layout');
layout.removeAllChildren();
layout.active = true;
const str = 'Now Loading...';
str.split('').forEach((word, idx) => {
const node = new cc.Node();
const label = node.addComponent(cc.Label);
label.string = word;
node.parent = layout;
node.color = colorList[idx];
cc.tween(node)
.delay(idx / 4)
.by(0.3, { y: 50 }, { easing: 'sineOut' })
.by(0.3, { y: -50 }, { easing: 'sineIn' })
.delay((str.length - idx) / 4)
.union()
.repeatForever()
.start();
});
const totalWidth = layout.children.reduce((width, node, idx) => {
return width + node.width;
}, 0);
layout.width = totalWidth;
},
hideWaitingLetters() {
const layout = cc.find('middleLayer/layout');
layout.active = false;
const waitingLayer = cc.find('middleLayer/waitingLayer');
waitingLayer.active = false;
},
showLog(str) {
if (!this.logList) {
this.logList = [];
}
this.logList.push(str);
console.log(str);
if (this.logList.length == 1) {
this.showOneLog();
}
},
showOneLog() {
const str = this.logList[0];
if (str === undefined) {
return;
}
const node = new cc.Node();
node.anchorX = 0.5;
const label = node.addComponent(cc.RichText);
label.string = `<outline color=black width=3>${str}</outline>`;
label.maxWidth = this.node.width / 2;
node.x = this.node.width / 4;
node.y = -this.node.height / 2;
node.parent = this.node;
cc.tween(node)
.to(5, { y: this.node.height })
.removeSelf()
.start();
setTimeout(() => {
this.logList.shift();
this.showOneLog();
}, 1000);
},
loadBundle(conf, callback) {
this.showWaitingLetters();
cc.assetManager.loadBundle(conf.bondleUrl, { version: conf.version }, async (err, bundle) => {
if (err) {
return this.asyncDelayLog(err);
}
bundle.loadScene(conf.sceneName, (err, scene) => {
if (err) {
this.asyncDelayLog('err: ', err);
}
cc.audioEngine.stopAll();
cc.director.runScene(scene, null, () => {
console.log('sceneName = ' + conf.sceneName);
const canvas = cc.find('Canvas');
const middleLayer = cc.find('middleLayer');
this.hideWaitingLetters();
callback && callback();
if (this.bundleType == 'StoryBox') {
canvas.getComponent(cc.Widget).updateAlignment();
middleLayer.getComponent(cc.Widget).updateAlignment();
const frameSize = cc.view.getFrameSize();
console.log(`Canvas.size = ${canvas.width}, ${canvas.height}`);
console.log(`frameSize.size = ${frameSize.width}, ${frameSize.height}`);
console.log(`middleLayer.size = ${middleLayer.width}, ${middleLayer.height}`);
const scale = (middleLayer.width / frameSize.width);
console.log('scale = ' + scale);
const middleLayerWidget = middleLayer.getComponent(cc.Widget);
middleLayerWidget.isAlignHorizontalCenter = true; // Boolean 是否水平方向对齐中点,开启此选项会将水平方向其他对齐选项取消。
middleLayerWidget.isAlignVerticalCenter = true; // Boolean 是否垂直方向对齐中点,开启此项会将垂直方向其他对齐选项取消。
// middleLayer.removeComponent(cc.Widget);
middleLayer.width = frameSize.width * scale;
middleLayer.height = frameSize.height * scale;
}
});
});
});
},
loadBundleByConf(conf, callback) {
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
this.loadBundle(conf.ios, callback);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
this.loadBundle(conf.android, callback);
} else {
this.loadBundle(conf.web_desktop, callback);
console.error('非源生环境');
}
},
exit() {
cc.game.removePersistRootNode(this.node);
cc.director.loadScene("emptyScene", () => {
this.callNativeFunction({ name: 'exit', value: '' });
});
},
getRainbowColorList() {
return [
cc.color(128, 0, 255),
cc.color(255, 0, 255),
cc.color(255, 0, 128),
cc.color(0, 0, 0),
cc.color(255, 0, 0),
cc.color(255, 128, 0),
cc.color(255, 255, 0),
cc.color(128, 255, 0),
cc.color(0, 255, 0),
cc.color(0, 255, 128),
cc.color(0, 255, 255),
cc.color(0, 128, 255),
cc.color(0, 0, 255),
cc.color(128, 0, 255),
];
}
});
{
"ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5",
"uuid": "363f36a9-434f-4848-85d3-82d42a168145",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
......@@ -165,7 +165,7 @@ export function getSprNodeByUrl(url, cb) {
export function playAudio(audioClip, cb = null) {
if (audioClip) {
const audioId = cc.audioEngine.playEffect(audioClip, false);
const audioId = cc.audioEngine.playEffect(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
......@@ -178,7 +178,7 @@ export async function asyncDelay(time) {
return new Promise((resolve, reject) => {
try {
setTimeout(() => {
resolve(null);
resolve();
}, time * 1000);
} catch (e) {
reject(e);
......@@ -296,7 +296,7 @@ export async function asyncTweenTo(node, duration, obj, ease = undefined) {
cc.tween(node)
.to(duration, obj, ease)
.call(() => {
resolve(null);
resolve();
})
.start();
} catch (e) {
......@@ -311,7 +311,7 @@ export async function asyncTweenBy(node, duration, obj, ease = undefined) {
cc.tween(node)
.by(duration, obj, ease)
.call(() => {
resolve(null);
resolve();
})
.start();
} catch (e) {
......
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "784f09f7-cb63-4d22-b26c-651af3457397",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"width": 84,
"height": 64,
"platformSettings": {},
"subMetas": {
"bg": {
"Btn": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "6ed1daae-8803-4472-9415-0b50186d62ec",
"rawTextureUuid": "784f09f7-cb63-4d22-b26c-651af3457397",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"width": 84,
"height": 64,
"rawWidth": 84,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -11,7 +11,7 @@
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_left": {
"btnLeft": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
......
......@@ -11,7 +11,7 @@
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_right": {
"btnRight": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
......
{
"ver": "1.1.2",
"uuid": "2236ac5a-1802-453c-ba53-fef4274b576f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "2ff84ffa-57c1-442a-8ce7-99247935c4fe",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"width": 19,
"height": 44,
"platformSettings": {},
"subMetas": {
"1orange": {
"arrow": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "a7bc980f-6a3c-484b-bce3-675e1d0b4fb6",
"rawTextureUuid": "2ff84ffa-57c1-442a-8ce7-99247935c4fe",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"offsetY": 0,
"trimX": 0,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"trimY": 0,
"width": 19,
"height": 44,
"rawWidth": 19,
"rawHeight": 44,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "79835fc1-6f9b-4b75-81a0-9e2563a9cda8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 48,
"height": 49,
"platformSettings": {},
"subMetas": {
"back_btn": {
"ver": "1.0.4",
"uuid": "8c27862c-fe5e-419d-aa76-66622194204f",
"rawTextureUuid": "79835fc1-6f9b-4b75-81a0-9e2563a9cda8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 48,
"height": 49,
"rawWidth": 48,
"rawHeight": 49,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "64008e44-1efc-4bb2-8d6a-4ea54e7f6a94",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"width": 50,
"height": 50,
"platformSettings": {},
"subMetas": {
"icon": {
"box_btn": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "7b989e72-92b4-4dad-bc24-c1dbca66851c",
"rawTextureUuid": "64008e44-1efc-4bb2-8d6a-4ea54e7f6a94",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"offsetY": 1.5,
"trimX": 11,
"trimY": 17,
"width": 28,
"height": 13,
"rawWidth": 50,
"rawHeight": 50,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "f0bb0a78-e2c7-4fae-9002-b490b7ec745e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 249,
"height": 136,
"platformSettings": {},
"subMetas": {
"bubble": {
"ver": "1.0.4",
"uuid": "bd8c5e4a-8343-4136-8c38-755da9c9dcb7",
"rawTextureUuid": "f0bb0a78-e2c7-4fae-9002-b490b7ec745e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 249,
"height": 136,
"rawWidth": 249,
"rawHeight": 136,
"borderTop": 85,
"borderBottom": 40,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6d4f75a8-0b66-45ea-be97-138c7c59761c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 50,
"height": 50,
"platformSettings": {},
"subMetas": {
"cancle_btn": {
"ver": "1.0.4",
"uuid": "203147c0-d683-4d42-8491-5d0936d9a8ad",
"rawTextureUuid": "6d4f75a8-0b66-45ea-be97-138c7c59761c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 2,
"trimX": 17,
"trimY": 15,
"width": 16,
"height": 16,
"rawWidth": 50,
"rawHeight": 50,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b479a6c9-94fc-4c91-92fa-41f23e995f34",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 94,
"platformSettings": {},
"subMetas": {
"item_btn": {
"ver": "1.0.4",
"uuid": "14d02de8-5840-4b1b-9043-033240a061b3",
"rawTextureUuid": "b479a6c9-94fc-4c91-92fa-41f23e995f34",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 94,
"rawWidth": 94,
"rawHeight": 94,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "82c704b5-ba52-44a5-91ea-dd00b0d87e7d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 94,
"platformSettings": {},
"subMetas": {
"item_btn_light": {
"ver": "1.0.4",
"uuid": "e250b93e-0842-4225-ba4e-be0e4d4f4a85",
"rawTextureUuid": "82c704b5-ba52-44a5-91ea-dd00b0d87e7d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 94,
"rawWidth": 94,
"rawHeight": 94,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cf22fcf3-99f6-4820-9541-9ee845509bec",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 94,
"platformSettings": {},
"subMetas": {
"item_btn_selected": {
"ver": "1.0.4",
"uuid": "28c67356-26a1-4ba6-88fa-0e27ce48e735",
"rawTextureUuid": "cf22fcf3-99f6-4820-9541-9ee845509bec",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 94,
"rawWidth": 94,
"rawHeight": 94,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3594e254-9171-4107-9839-3506e88067fc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 4,
"height": 2000,
"platformSettings": {},
"subMetas": {
"line": {
"ver": "1.0.4",
"uuid": "220bb92a-5a8c-45e0-a9f4-b5aeba479944",
"rawTextureUuid": "3594e254-9171-4107-9839-3506e88067fc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 4,
"height": 2000,
"rawWidth": 4,
"rawHeight": 2000,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1663a729-7497-4302-b6ed-45f487c477e8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 50,
"height": 50,
"platformSettings": {},
"subMetas": {
"line_btn": {
"ver": "1.0.4",
"uuid": "a4270fa6-543e-4a53-961c-7108edc4ca94",
"rawTextureUuid": "1663a729-7497-4302-b6ed-45f487c477e8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 50,
"height": 50,
"rawWidth": 50,
"rawHeight": 50,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a5dad938-28a8-4ad5-a4c4-32a427581d66",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 166,
"height": 43,
"platformSettings": {},
"subMetas": {
"option": {
"ver": "1.0.4",
"uuid": "f411c1ea-6c83-43c0-b169-88a2690464e0",
"rawTextureUuid": "a5dad938-28a8-4ad5-a4c4-32a427581d66",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 166,
"height": 43,
"rawWidth": 166,
"rawHeight": 43,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "725cb20e-5df6-4d25-8da9-f4fc749ce955",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 184,
"height": 78,
"platformSettings": {},
"subMetas": {
"title_bg": {
"ver": "1.0.4",
"uuid": "f3e0ff5f-9467-4474-a216-24ad0a7fe987",
"rawTextureUuid": "725cb20e-5df6-4d25-8da9-f4fc749ce955",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 184,
"height": 78,
"rawWidth": 184,
"rawHeight": 78,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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