future 1 vuosi sitten
vanhempi
sitoutus
96b5eeae08

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 369 - 378
assets/resources/prefabs/game_play_ji_yi_li.prefab


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 248 - 943
assets/resources/prefabs/game_play_shuang_tu_zhao_bu_tong.prefab


+ 6 - 28
assets/script/play_list/base_view.ts

@@ -23,7 +23,6 @@ export class base_view extends Component {
     @property(Node) btn_look_video:Node = null;
     @property(Node) btn_tip:Node = null;
     @property(Node) btn_coin:Node = null;
-    @property(ProgressBar) progressbar:ProgressBar = null;
     @property(Node) lab_title:Node = null;
     @property(Node) lab_coin: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(Prefab) addCoinAni:Prefab = 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;
     protected guid_view:Node = null;
     protected time_count:number = 0;
@@ -110,9 +107,6 @@ export class base_view extends Component {
         })
     }
     reset_time_count(){
-        if(this.lab_time_count!=null){
-            this.lab_time_count.getComponent(Label).string = ""
-        }
         if(this.lab_countdown_time!=null){
             this.lab_countdown_time.getComponent(Label).string = ""
         }
@@ -173,42 +167,30 @@ export class base_view extends Component {
         this.unscheduleAllCallbacks()
     }
     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.lab_time_count.active = true;
-       
+        this.lab_countdown_time.active = true;
+
         let self = this;
         this.time_count = 0;
-        if(self.progressbar){
-            self.progressbar.progress = 1;
-        }
         
-        if(self.clock_ani){
-            self.clock_ani.getComponent(clock_angle).init();
-        }
         this.schedule(()=>{
             if(self.isPause){
                 return;
             }
             if(self.time_count<self.time_all_count){
                 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){
-                    // 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{
-                    // 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(()=>{
                     //     self.lab_countdown_time.scale = new Vec3(1,1,1)  
                     // }).start()
                 }
        
             }else{
-                // self.lab_time_count.getComponent(Label).string = "0s";
                 self.lab_countdown_time.getComponent(Label).string = "0s";
                 if(this.categoryid===config.PLAY_TYPE.JI_YI_LI){
                     self.showQuestion()
@@ -223,14 +205,11 @@ export class base_view extends Component {
         let self = this;
         if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
             self.time_all_count = 0;
-            // self.lab_time_count.getComponent(Label).string = "0s";
             self.lab_countdown_time.getComponent(Label).string = "0s";
         }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.time_count += self.m_data.wrong_time;
         }
-        self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
     }
     /**
         计时api end 
@@ -381,7 +360,6 @@ export class base_view extends Component {
         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.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)
         tween(lab_err_number).to(0.5, {position: end_pos}).removeSelf().start()
     }

+ 36 - 35
assets/script/play_list/ji_yi_li/view_game_play_ji_yi_li.ts

@@ -12,43 +12,44 @@ const { ccclass, property } = _decorator;
 
 @ccclass('view_game_play_ji_yi_li')
 export class view_game_play_ji_yi_li extends base_view {
-  @property(Node) img_1:Node;
-  @property(Node) bottom_node:Node;
-  @property(Node) question_node:Node;
+  @property(Node) img_1: Node;
+  @property(Node) bottom_node: Node;
+  @property(Node) question_node: Node;
   protected initUI(): void {
   }
 
   public initView(data: any, isUpdate?: boolean): void {
-    this.m_data  = data;
+    this.m_data = data;
     let self = this;
     this.categoryid = config.PLAY_TYPE.JI_YI_LI
     let levels_item = gameManager.get_cur_level_by_categoryid(this.categoryid);
-    let call_back = ()=>{
+    let call_back = () => {
       self.initAnswerView()
     }
-    tools.loadRemoteImgByCategoryid(this.categoryid,levels_item.level,this.m_data.img,(sf)=>{
-        self.img_1.getComponent(Sprite).spriteFrame = sf;
-        call_back();
+    tools.loadRemoteImgByCategoryid(this.categoryid, levels_item.level, this.m_data.img, (sf) => {
+      self.img_1.getComponent(Sprite).spriteFrame = sf;
+      call_back();
+    })
+    gameManager.loadPlayMusicByCategoryId(this.categoryid, () => {
+      gameManager.playGamePlayMusicByCategoryId(this.categoryid, true);
     })
-    gameManager.loadPlayMusicByCategoryId(this.categoryid,()=>{
-      gameManager.playGamePlayMusicByCategoryId(this.categoryid,true);
-  })
   }
 
-  showStep1(){
+  showStep1() {
     this.img_1.active = true;
     this.question_node.active = false;
     this.lab_title.active = true;
+    this.bottom_node.active = true;
   }
-  showStep2(){
+  showStep2() {
     this.img_1.active = false;
     this.question_node.active = true;
     this.lab_title.active = false;
     this.bottom_node.active = false;
   }
-  initAnswerView(){
+  initAnswerView() {
     this.showStep1()
-    let index = Util.getRandomInt(0,this.m_data.memory_problem.length-1);
+    let index = Util.getRandomInt(0, this.m_data.memory_problem.length - 1);
     this.isShowWin = false;
     this.old_coin_number = gameManager.get_user_coin();
     this.lab_coin.getComponent(Label).string = Util.coinNumberToK(this.old_coin_number);
@@ -56,14 +57,14 @@ export class view_game_play_ji_yi_li extends base_view {
     let problem = this.m_data.memory_problem[index];
     let answer = this.m_data.memory_answer[index];
     let correct_answer = this.m_data.memory_correct_answer[index];
-    this.question_node.getComponent(question).initView(problem,answer,correct_answer,this.on_question_item_click.bind(this))
+    this.question_node.getComponent(question).initView(problem, answer, correct_answer, this.on_question_item_click.bind(this))
     this.start_time_count(this.m_data.s_time)
   }
 
-  on_question_item_click(isRight:boolean){
-    if(isRight){
+  on_question_item_click(isRight: boolean) {
+    if (isRight) {
       this.showWin()
-    }else{
+    } else {
       this.showFail()
     }
   }
@@ -75,26 +76,26 @@ export class view_game_play_ji_yi_li extends base_view {
   protected onFailReStartClick(fail_view: fail): void {
     gameManager.playBtnSound()
     let self = this;
-    if(this.m_data.ads_restart==1){
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Resume_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.initAnswerView()
-                fail_view.close()
-            }
-            // 统计-激励视频广告
-            let collect_data = StatisticsManager.get_collect_data(this.categoryid, this.m_data.id, 0, res, config.STATISTICS_ACTION_TYPE.CHONG_XIN_KAI_SHI)
-            StatisticsManager.request_collect_rewardVideoData(collect_data)
-        })
-    }else{
-        fail_view.close()
-        self.initAnswerView()
+    if (this.m_data.ads_restart == 1) {
+      SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Resume_AdUnitId, (res) => {
+        if (res.isEnded) {
+          self.initAnswerView()
+          fail_view.close()
+        }
+        // 统计-激励视频广告
+        let collect_data = StatisticsManager.get_collect_data(this.categoryid, this.m_data.id, 0, res, config.STATISTICS_ACTION_TYPE.CHONG_XIN_KAI_SHI)
+        StatisticsManager.request_collect_rewardVideoData(collect_data)
+      })
+    } else {
+      fail_view.close()
+      self.initAnswerView()
     }
   }
 
   protected onFailQuitClick(fail_view: fail): void {
-      gameManager.playBtnSound()
-      fail_view.close()
-      this.close()
+    gameManager.playBtnSound()
+    fail_view.close()
+    this.close()
   }
 
 }

+ 1 - 1
assets/script/play_list/zhaocha_up_down/view_game_play_shuang_tu_zhao_bu_tong.ts

@@ -301,7 +301,7 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends base_view {
         }
         let self = this;
         self.isShowWin = false;
-        this.lab_time_count.active = false;
+        this.lab_countdown_time.active = false;
         gameManager.decRefSf(this.categoryid);
         let call_back = ()=>{
             if(count>=2){

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä