|
@@ -23,7 +23,6 @@ export class base_view extends Component {
|
|
@property(Node) btn_look_video:Node = null;
|
|
@property(Node) btn_look_video:Node = null;
|
|
@property(Node) btn_tip:Node = null;
|
|
@property(Node) btn_tip:Node = null;
|
|
@property(Node) btn_coin:Node = null;
|
|
@property(Node) btn_coin:Node = null;
|
|
- @property(ProgressBar) progressbar:ProgressBar = null;
|
|
|
|
@property(Node) lab_title:Node = null;
|
|
@property(Node) lab_title:Node = null;
|
|
@property(Node) lab_coin:Node = null;
|
|
@property(Node) lab_coin:Node = null;
|
|
@property(Node) img_touch_err:Node = null;
|
|
@property(Node) img_touch_err:Node = null;
|
|
@@ -32,8 +31,6 @@ export class base_view extends Component {
|
|
@property(SpriteFrame) sf_btn_pause:SpriteFrame = null;
|
|
@property(SpriteFrame) sf_btn_pause:SpriteFrame = null;
|
|
@property(Prefab) addCoinAni:Prefab = null;
|
|
@property(Prefab) addCoinAni:Prefab = null;
|
|
@property(Node) top_node:Node = null;
|
|
@property(Node) top_node:Node = null;
|
|
- @property(Node) lab_time_count:Node = null;
|
|
|
|
- @property(Node) clock_ani:Node = null;
|
|
|
|
@property(Node) lab_countdown_time:Node = null;
|
|
@property(Node) lab_countdown_time:Node = null;
|
|
protected guid_view:Node = null;
|
|
protected guid_view:Node = null;
|
|
protected time_count:number = 0;
|
|
protected time_count:number = 0;
|
|
@@ -110,9 +107,6 @@ export class base_view extends Component {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
reset_time_count(){
|
|
reset_time_count(){
|
|
- if(this.lab_time_count!=null){
|
|
|
|
- this.lab_time_count.getComponent(Label).string = ""
|
|
|
|
- }
|
|
|
|
if(this.lab_countdown_time!=null){
|
|
if(this.lab_countdown_time!=null){
|
|
this.lab_countdown_time.getComponent(Label).string = ""
|
|
this.lab_countdown_time.getComponent(Label).string = ""
|
|
}
|
|
}
|
|
@@ -173,42 +167,30 @@ export class base_view extends Component {
|
|
this.unscheduleAllCallbacks()
|
|
this.unscheduleAllCallbacks()
|
|
}
|
|
}
|
|
start_time_count(time:number){
|
|
start_time_count(time:number){
|
|
- // if(this.lab_time_count==null){
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
|
|
+ if(this.lab_countdown_time==null){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.time_all_count = time;
|
|
this.time_all_count = time;
|
|
- // this.lab_time_count.active = true;
|
|
|
|
-
|
|
|
|
|
|
+ this.lab_countdown_time.active = true;
|
|
|
|
+
|
|
let self = this;
|
|
let self = this;
|
|
this.time_count = 0;
|
|
this.time_count = 0;
|
|
- if(self.progressbar){
|
|
|
|
- self.progressbar.progress = 1;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- if(self.clock_ani){
|
|
|
|
- self.clock_ani.getComponent(clock_angle).init();
|
|
|
|
- }
|
|
|
|
this.schedule(()=>{
|
|
this.schedule(()=>{
|
|
if(self.isPause){
|
|
if(self.isPause){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if(self.time_count<self.time_all_count){
|
|
if(self.time_count<self.time_all_count){
|
|
self.time_count+=1;
|
|
self.time_count+=1;
|
|
|
|
+ self.lab_countdown_time.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
if(this.categoryid===config.PLAY_TYPE.JI_YI_LI){
|
|
if(this.categoryid===config.PLAY_TYPE.JI_YI_LI){
|
|
- // self.lab_time_count.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
|
|
- self.lab_countdown_time.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
|
|
}else{
|
|
}else{
|
|
- // self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
|
|
|
|
- // self.lab_time_count.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
|
|
- self.lab_countdown_time.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
|
|
- // self.clock_ani.getComponent(clock_angle).addSecond();
|
|
|
|
// tween(self.lab_countdown_time).to(0.8,{scale: new Vec3(2, 2, 1)}).call(()=>{
|
|
// tween(self.lab_countdown_time).to(0.8,{scale: new Vec3(2, 2, 1)}).call(()=>{
|
|
// self.lab_countdown_time.scale = new Vec3(1,1,1)
|
|
// self.lab_countdown_time.scale = new Vec3(1,1,1)
|
|
// }).start()
|
|
// }).start()
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
}else{
|
|
- // self.lab_time_count.getComponent(Label).string = "0s";
|
|
|
|
self.lab_countdown_time.getComponent(Label).string = "0s";
|
|
self.lab_countdown_time.getComponent(Label).string = "0s";
|
|
if(this.categoryid===config.PLAY_TYPE.JI_YI_LI){
|
|
if(this.categoryid===config.PLAY_TYPE.JI_YI_LI){
|
|
self.showQuestion()
|
|
self.showQuestion()
|
|
@@ -223,14 +205,11 @@ export class base_view extends Component {
|
|
let self = this;
|
|
let self = this;
|
|
if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
|
|
if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
|
|
self.time_all_count = 0;
|
|
self.time_all_count = 0;
|
|
- // self.lab_time_count.getComponent(Label).string = "0s";
|
|
|
|
self.lab_countdown_time.getComponent(Label).string = "0s";
|
|
self.lab_countdown_time.getComponent(Label).string = "0s";
|
|
}else{
|
|
}else{
|
|
- // self.lab_time_count.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
|
|
self.lab_countdown_time.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
self.lab_countdown_time.getComponent(Label).string = `${this.time_all_count-this.time_count}s`
|
|
self.time_count += self.m_data.wrong_time;
|
|
self.time_count += self.m_data.wrong_time;
|
|
}
|
|
}
|
|
- self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
|
|
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
计时api end
|
|
计时api end
|
|
@@ -381,7 +360,6 @@ export class base_view extends Component {
|
|
lab_err_number.getComponent(Label).fontSize = 25;
|
|
lab_err_number.getComponent(Label).fontSize = 25;
|
|
lab_err_number.position = new Vec3(lab_err_number.position.x,30,lab_err_number.position.z)
|
|
lab_err_number.position = new Vec3(lab_err_number.position.x,30,lab_err_number.position.z)
|
|
lab_err_number.getComponent(Label).isBold = true;
|
|
lab_err_number.getComponent(Label).isBold = true;
|
|
- this.clock_ani.getComponent(clock_angle).play()
|
|
|
|
let end_pos = new Vec3(lab_err_number.position.x,lab_err_number.position.y+20,lab_err_number.position.z)
|
|
let end_pos = new Vec3(lab_err_number.position.x,lab_err_number.position.y+20,lab_err_number.position.z)
|
|
tween(lab_err_number).to(0.5, {position: end_pos}).removeSelf().start()
|
|
tween(lab_err_number).to(0.5, {position: end_pos}).removeSelf().start()
|
|
}
|
|
}
|