Commit 0fe595c3 authored by liujiangnan's avatar liujiangnan

feat: 去掉一个JS

parent f196d3df
......@@ -15,9 +15,6 @@
"_children": [
{
"__id__": 2
},
{
"__id__": 493
}
],
"_active": true,
......@@ -76,21 +73,15 @@
},
{
"__id__": 5
},
{
"__id__": 488
}
],
"_active": true,
"_components": [
{
"__id__": 490
},
{
"__id__": 491
"__id__": 488
},
{
"__id__": 492
"__id__": 489
}
],
"_prefab": null,
......@@ -20748,100 +20739,6 @@
],
"_id": "dbT6tMZutH/Y58xXsjUXqp"
},
{
"__type__": "cc.Node",
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 489
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c2WAdbwStIvIHfzf0QSv1Y"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 488
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"height": 200
},
"_resize": 1,
"_N$layoutType": 1,
"_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": "29Y+oTmsNPB6uSBOKjIYkA"
},
{
"__type__": "cc.Canvas",
"_name": "",
......@@ -20885,90 +20782,5 @@
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "1a8e6qNBcdCf6xuwOAYJuBB",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "8fs+P5YTtKGr7GBrV5R431"
},
{
"__type__": "cc.Node",
"_name": "cacertNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 494
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d6OZ5YlbNPYKExNXuwR6pL"
},
{
"__type__": "42b96eeIeZKHZKJdVfS5dD7",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 493
},
"_enabled": true,
"cacertFile": {
"__uuid__": "fd279805-6e95-474f-ac26-e19034f2b093"
},
"_id": "bc9QrFiwtFMrZEN9xsh2Av"
}
]
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
},
start() {
const layout = cc.find('Canvas/layout');
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;
// 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;
const baseUrl = 'https://staging-teach.ireadabc.com';
const uri = '/api/template/v1/middleLayer_for_debug'
const reqData = {};
cc.game.addPersistRootNode(cc.find('cacertNode'));
this.callNetworkApiGet(baseUrl, uri, reqData, (respData) => {
// console.log(respData);
const data = JSON.parse(respData);
let configData = data.data.conf.web_desktop;
if (cc.sys.os == cc.sys.OS_IOS) {
configData = data.data.conf.ios;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
configData = data.data.conf.android;
}
console.log('汪汪汪: ' + configData.sceneName);
cc.assetManager.loadBundle(configData.bondleUrl, { version: configData.version }, async (err, bundle) => {
if (err) {
return this.asyncDelayLog(err);
}
// 方便Debug壳的打包
const isDebug = cc.find('Canvas/MainScene').active === false;
if(isDebug){
// 如果没有牛津的主界面,就显示debug的界面,方便调试
bundle.loadScene(configData.sceneName, null, null, (e, scene) => {
if (e) {
return this.asyncDelayLog(e);
}
cc.director.runScene(scene);
});
}
const canvas = cc.find('Canvas');
canvas.emit('MIDDLE_LAYER_LOADED', { scene: null });
globalThis.configData = configData;
});
});
},
callNetworkApiGet(baseUrl, uri, data, callBack) {
let queryStr = '?';
for (const key in data) {
if (Object.hasOwnProperty.call(data, key)) {
const value = data[key];
queryStr += `${key}=${value}`;
}
}
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
callBack(xhr.responseText);
}
};
const url = `${baseUrl}${uri}${queryStr}`;
console.log('url = ' + url);
xhr.open('GET', url, true);
xhr.send();
},
});
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"ver": "1.0.1",
"uuid": "fd279805-6e95-474f-ac26-e19034f2b093",
"subMetas": {}
}
\ No newline at end of file
......@@ -63,7 +63,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
callOcMethod(method, param) {
console.warn('callOcMethod')
const paramStr = JSON.stringify(param);
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
return jsb.reflection.callStaticMethod('RootViewController', `${method}:`, paramStr);
......@@ -99,7 +98,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
start() {
this.rootAttrTree = this.getComponent('Attributes');
this.showWaitingLetters();
this.initBg();
this.initUnitViewPager();
this.createFiniteStateMachines();
......@@ -180,12 +178,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
that.initialized();
}
// @ts-ignores
const success = this.callOcMethod('getEngineInfo');
if (success) {
console.log("callOcMethod('getEngineInfo') success " + success);
} else {
console.log("callOcMethod('getEngineInfo') error " + success);
}
if (!cc.sys.isNative) {
// @ts-ignores
window.air.getEngineInfoCallback({isDev: 1})
......@@ -273,11 +265,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
createFiniteStateMachines() {
const canvas = cc.find('Canvas');
canvas.on('MIDDLE_LAYER_LOADED', ({ scene }) => {
this.hideWaitingLetters();
});
const operationState = {
id: 'operation',
initial: 'FerrisView',
......
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "1a8e6a8d-05c7-427f-ac6e-c0e01826e041",
"uuid": "98bb732c-87a6-4c3b-814e-ec88993efa39",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
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