结束界面主要是对一些数据进行重置还有界面按钮的一些操作
直接看代码吧
cc.Class({
extends: cc.Component,
Restart:cc.Node,
Exit:cc.Node,
GoToMain:cc.Node,
Releve:cc.Node,
count:0,
GameUI:cc.Node,
onLoad () {
this.InitComponent();
},
onEnable()
{
this.AddListener();
window.AudioController.playerBG(window.Constant.GameClip.overBgm);
this.Score.string=window.window.data.GameRunData.totalSocre.toString();
},
onDisable()
{
this.RemoveListener();
},
InitComponent()
{
this.BG=cc.find("BG",this.node);
this.Restart=cc.find("Restart",this.BG);
this.GoToMain=cc.find("GoToMain",this.BG);
this.ScoreNo=cc.find("Score",this.BG);
this.Score=this.ScoreNo.getComponent(cc.Label);
},
AddListener()
{
this.RestartEvent=this.Restart.on(cc.Node.EventType.TOU