Commit a064c581 authored by liujiaxin's avatar liujiaxin

feat: backfoor

parent e5210d9c
...@@ -52,6 +52,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -52,6 +52,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property([cc.Node]) @property([cc.Node])
FullPageNode: cc.Node[] = []; FullPageNode: cc.Node[] = [];
@property(cc.Node)
BackDoorNode: cc.Node = null;
tws: any[] = []; tws: any[] = [];
gameMachineService: any = null; gameMachineService: any = null;
...@@ -449,6 +452,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -449,6 +452,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showWaitingLetters(); this.showWaitingLetters();
cc.audioEngine.stopMusic(); cc.audioEngine.stopMusic();
const configData = globalThis.configData; const configData = globalThis.configData;
console.log(this);
let isDebug = false;
if (this.BackDoorNode) {
const bd = this.BackDoorNode.getComponent('BackDoor');
if (bd && bd.isDebug) {
isDebug = true;
}
}
cc.assetManager.loadBundle(configData.bondleUrl, { version: configData.version }, async (err, bundle) => { cc.assetManager.loadBundle(configData.bondleUrl, { version: configData.version }, async (err, bundle) => {
if (err) { if (err) {
return console.log(err); return console.log(err);
...@@ -456,10 +467,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -456,10 +467,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
bundle.loadScene(configData.sceneName, null, null, (err, scene) => { bundle.loadScene(configData.sceneName, null, null, (err, scene) => {
cc.director.runScene(scene, null, () => { cc.director.runScene(scene, null, () => {
try { try {
console.log('汪汪汪')
const middleLayer = cc.find('middleLayer').getComponent('middleLayer'); const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
console.log(event.id, event.linkFlag); console.log(event.id, event.linkFlag);
if (!isDebug) {
middleLayer.loadOnlineCourseWare(event.id, event.linkFlag); middleLayer.loadOnlineCourseWare(event.id, event.linkFlag);
}
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
// @property(cc.Label)
// label: cc.Label = null;
// @property
// text: string = 'hello';
@property
need: number = 5;
touchCounter = 0;
countTimer = null;
isDebug = false;
// touchTimeline = [];
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
this.node.on(cc.Node.EventType.TOUCH_START, () => {
// console.log(Date.now());
// this.touchTimeline.push(Date.now());
this.touchCounter++;
if (!this.countTimer) {
this.countTimer = setTimeout(() =>{
this.touchCounter = 0;
clearTimeout(this.countTimer);
this.countTimer = null;
}, 2000);
}
if (this.touchCounter == this.need) {
clearTimeout(this.countTimer);
this.countTimer = null;
if (this.isDebug) {
this.node.color = new cc.Color(255, 255, 255,255);
this.isDebug = false;
} else {
this.node.color = new cc.Color(3, 246, 18,255);
this.isDebug = true;
}
}
});
}
// update (dt) {}
}
{
"ver": "1.0.8",
"uuid": "9c2d1f95-a5c9-46fb-bccb-d8ddfea5bc5c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"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