|
@@ -28,19 +28,24 @@ export class SuperFindPanel extends Component {
|
|
|
tipLabel2: Label = null
|
|
|
@property(Label)
|
|
|
showOrHideScaleLabel: Label = null
|
|
|
+ @property(Label)
|
|
|
+ countDownLabel: Label = null
|
|
|
|
|
|
@property(Node)
|
|
|
bottom: Node = null
|
|
|
|
|
|
_showScale:boolean = false
|
|
|
+ _gameTime:number = 600
|
|
|
|
|
|
protected start(): void {
|
|
|
this.init()
|
|
|
EventMgr.ins.addEventListener("refreshLevelInfo",this.refreshInfo,this)
|
|
|
+ this.restartCountDown()
|
|
|
}
|
|
|
init()
|
|
|
{
|
|
|
this.refreshInfo()
|
|
|
+ this.countDownLabel.string = this._gameTime.toString()+"秒"
|
|
|
let bgPath = SuperFind.superFindData.imgPath
|
|
|
let selectSkins:string[] = Skin.getSelectSkinPath()
|
|
|
selectSkins = selectSkins.length > 0?selectSkins:[defaultSkin]
|
|
@@ -119,6 +124,24 @@ export class SuperFindPanel extends Component {
|
|
|
this.lvlContainer.showOrHideScale(this._showScale)
|
|
|
this.showOrHideScaleLabel.string = this._showScale?"隐藏缩放":"显示缩放"
|
|
|
}
|
|
|
+
|
|
|
+ countDown() {
|
|
|
+ this._gameTime--
|
|
|
+ if (this._gameTime <= 0) {
|
|
|
+ this.unschedule(this.countDown)
|
|
|
+ this.countDownLabel.string = "0秒"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.countDownLabel.string = this._gameTime.toString() + "秒"
|
|
|
+ }
|
|
|
+
|
|
|
+ restartCountDown()
|
|
|
+ {
|
|
|
+ this._gameTime = 600
|
|
|
+ this.countDownLabel.string = this._gameTime.toString()+"秒"
|
|
|
+ this.unschedule(this.countDown)
|
|
|
+ this.schedule(this.countDown,1)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|