50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
// 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
|
|
|
|
import GameData from "./GameData";
|
|
import AudioManager from "./tool/AudioManager";
|
|
import { GameTool } from "./tool/GameTool";
|
|
import { StorageMessage } from "./tool/Storage";
|
|
import { WeChat } from "./tool/share";
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class NewClass extends cc.Component {
|
|
|
|
@property(cc.Label)
|
|
label: cc.Label = null;
|
|
|
|
@property
|
|
text: string = 'hello';
|
|
|
|
// onLoad () {}
|
|
|
|
start () {
|
|
GameTool.Authentication();
|
|
WeChat.setShare(location.href);
|
|
}
|
|
|
|
click(){
|
|
AudioManager._instance.playMusicGame();
|
|
if(GameData._instance.GM_INFO.probation){
|
|
cc.director.loadScene("GuideScene");
|
|
}
|
|
else{
|
|
cc.director.loadScene("GameScene");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
openRank(){
|
|
AudioManager._instance.playMusicGame();
|
|
cc.director.loadScene("RankScene");
|
|
}
|
|
// update (dt) {}
|
|
}
|