init
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
properties: {},
|
||||
start: function () {
|
||||
console.log("到这1111111111");
|
||||
cc.global.levelDataScript = this;
|
||||
cc.global.levelDate = cc.playerData.game1_level;
|
||||
cc.global.levellist = [].concat(cc.global.game1_levelOrder);
|
||||
cc.global.gameModel = "game1";
|
||||
this.creatorXuanguan();
|
||||
},
|
||||
updateData: function (e) {
|
||||
console.log("进来执行吗?" + e);
|
||||
cc.playerData.game1_level = e;
|
||||
cc.global.levelDate = cc.playerData.game1_level;
|
||||
cc.global.savePlayerData();
|
||||
},
|
||||
creatorXuanguan: function () {
|
||||
console.log("到这22222222222");
|
||||
var e = this;
|
||||
cc.loader.loadRes("prefab/ui/Hall_XuanGuan", function (o, t) {
|
||||
if (!o && t instanceof cc.Prefab) {
|
||||
console.log("到这33333333333333");
|
||||
var i = cc.instantiate(t);
|
||||
i.parent = e.node;
|
||||
i.getComponent("LevelScript").initdata(cc.global.levelDate, cc.global.levellist);
|
||||
i.zIndex = 999;
|
||||
i.position = cc.v2(0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user