|
|
@@ -7,8 +7,27 @@ cc.Class({
|
|
|
|
|
|
progressBar_hp: cc.Node,
|
|
|
progressBar_endur: cc.Node,
|
|
|
+
|
|
|
+ //PlayerState: cc.Node,
|
|
|
+ AiPlayerState: cc.Node,
|
|
|
+
|
|
|
+ PanelResult: cc.Node,
|
|
|
+
|
|
|
+ ResultArr: {
|
|
|
+ default: [],
|
|
|
+ type: cc.Prefab,
|
|
|
+ },
|
|
|
+ interface_game: cc.Node,
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ // cc.loader.loadResDir("prefab/Result", cc.Prefab, (err, ResultArr) => {
|
|
|
+ // // ...
|
|
|
+ // console.log("belt预设:", );
|
|
|
+ // for (let i = 0; i < ResultArr.length; i++) {
|
|
|
+ // this.ResultArr[i] = ResultArr[i];
|
|
|
+ // }
|
|
|
+
|
|
|
+ // });
|
|
|
this._super();
|
|
|
this._hp = this.hp;
|
|
|
this._maxhp = this.maxhp; //血量
|
|
|
@@ -76,12 +95,24 @@ cc.Class({
|
|
|
}, 1);
|
|
|
},
|
|
|
start() {
|
|
|
-
|
|
|
+ this.init();
|
|
|
},
|
|
|
init() {
|
|
|
//角色脚本
|
|
|
this.controScp = this.playerController.getComponent('PlayerController');
|
|
|
this.charactortroScp = this.Charactor.getComponent('Charactor');
|
|
|
+
|
|
|
+ //this.playerStateScp = this.PlayerState.getComponent('PlayerStates');
|
|
|
+ this.aiplayerStateScp = this.AiPlayerState.getComponent('AiPlayerStates');
|
|
|
+ },
|
|
|
+ update(dt) {
|
|
|
+ let result = this.Result_Show(this._hp, this.aiplayerStateScp._hp);
|
|
|
+ if (result) {
|
|
|
+ this.PanelResult.addChild(cc.instantiate(this.ResultArr[1]));
|
|
|
+ this.interface_game.active = false;
|
|
|
+ this.scheduleOnce(function() {
|
|
|
+
|
|
|
+ }, 2);
|
|
|
+ }
|
|
|
},
|
|
|
- update(dt) {},
|
|
|
});
|