woso_javan 1 сар өмнө
parent
commit
5c8d3e9667

+ 10 - 3
assets/module_aliens/Prefabs/UI/Gambit/UI_BattleGambit_Impl.ts

@@ -8,6 +8,7 @@ import { GlobalConfig } from 'db://assets/start/Config/GlobalConfig';
 import { AdvertMgr } from 'db://assets/core_tgx/base/ad/AdvertMgr';
 import { UserManager } from '../../../Script/Manager/UserMgr';
 import { GameEvent } from '../../../Script/Enum/GameEvent';
+import { TimerMgr } from '../../../Script/Manager/TimerMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('UI_BattleGambit_Impl')
@@ -26,18 +27,24 @@ export class UI_BattleGambit_Impl extends UI_BattleGambit {
         this.onButtonEvent(layout.btn_get, () => {
             if (!GlobalConfig.isDebug) {
                 AdvertMgr.instance.showReawardVideo(() => {
-
+                    this.addFreeCount(); 
+                    this.startCountdown();
                 })
             } else {
                 this.addFreeCount(); 
-                this.hide();
+                this.startCountdown();
             }
         });
         this.onButtonEvent(layout.btn_back, () => {
-            this.hide();
+            this.startCountdown();
         });
     }
 
+    private startCountdown() {
+        this.hide();
+        TimerMgr.inst.startCountdown(); 
+    }
+
     //增加情报和侦探免费次数
     private addFreeCount() {
         UserManager.instance.addFreeScreenShotCount(1);

+ 6 - 0
assets/module_aliens/RoosterAliens.ts

@@ -11,6 +11,7 @@ import { UI_PowerUp, UI_Setting } from '../scripts/UIDef';
 import { tgxUIMgr } from '../core_tgx/tgx';
 import { EventDispatcher } from '../core_tgx/easy_ui_framework/EventDispatcher';
 import { UserManager } from './Script/Manager/UserMgr';
+import { TimerMgr } from './Script/Manager/TimerMgr';
 const { ccclass, property } = _decorator;
 
 const duration = 0.3;
@@ -24,6 +25,11 @@ export class RoosterAliens extends Component {
         LevelManager.instance.initilizeModel();
         AliensGlobalInstance.instance.initUI(); //初始化u
         this.registerListener();
+        this.resetMgr(); 
+    }
+
+    private resetMgr() {
+        TimerMgr.inst.reset();
     }
 
     protected start(): void {

+ 4 - 8
assets/module_aliens/Script/LevelAction.ts

@@ -11,11 +11,9 @@ import { tgxUIMgr } from '../../core_tgx/tgx';
 import { UI_BattleGambit } from '../../scripts/UIDef';
 
 const { ccclass, property } = _decorator;
+//动画时长
+export const ANIMATION_DURATION = 0.5;
 
-enum ERaycastType {
-    ALL,
-    CLOSEST
-}
 @ccclass('LevelAction')
 export class LevelAction extends Component {
 
@@ -41,7 +39,6 @@ export class LevelAction extends Component {
     private _originalRotation: Vec3 = v3();
 
     //镜头拉近属性
-    private _zoomDuration: number = 0.5; // 拉近持续时间(秒)
     private isTweening: boolean = false;
 
     onLoad(): void {
@@ -147,7 +144,7 @@ export class LevelAction extends Component {
         const targetPos = currentPos.add(forward.multiplyScalar(distance));
         
         tween(this.camera.node.position)
-            .to(this._zoomDuration, targetPos, {
+            .to(ANIMATION_DURATION, targetPos, {
                 easing: 'smooth',
                 onUpdate: (target: Vec3) => {
                     this.camera.node.position = target;
@@ -191,7 +188,7 @@ export class LevelAction extends Component {
  
          this.isTweening = true;
          tween(tweenObj)
-             .to(0.5, {
+             .to(ANIMATION_DURATION, {
                  pitch: targetPitch,
                  yaw: targetYaw
              }, {
@@ -205,7 +202,6 @@ export class LevelAction extends Component {
                  }
              })
              .start();
-
     }
 
     private adjustRotationLimits() {

+ 1 - 1
assets/module_aliens/Script/Manager/TimerMgr.ts

@@ -90,6 +90,6 @@ export class TimerMgr {
         this.isPaused = false;  // 重置暂停状态
         Scheduler.enableForTarget(this);
         director.getScheduler().unscheduleAllForTarget(this);
-        this.countDownTime = 10; //测试
+        this.countDownTime = 5; //测试
     }
 }

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 322 - 113
assets/module_aliens/rooster_aliens.scene


+ 1 - 1
temp/profiles/packages/scene.json

@@ -1,3 +1,3 @@
 {
-  "current-scene": ""
+  "current-scene": "be14c61f-22d8-4bb9-b444-ad9f29740469"
 }

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно