greg před 4 roky
rodič
revize
365a96c49d

+ 8 - 5
assets/resources/ui/DropBoxUI.prefab

@@ -723,7 +723,7 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "_componentId": "f5c2cpXt/hPBY8XJPTMOk0k",
     "handler": "VideoButtonClickHandler",
     "customEventData": ""
   },
@@ -1196,7 +1196,7 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "_componentId": "f5c2cpXt/hPBY8XJPTMOk0k",
     "handler": "DiamondButtonClickHandler",
     "customEventData": ""
   },
@@ -1546,7 +1546,7 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "_componentId": "f5c2cpXt/hPBY8XJPTMOk0k",
     "handler": "CloseButtonClickHandler",
     "customEventData": ""
   },
@@ -1731,7 +1731,7 @@
         "__id__": 63
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
         "__id__": 68
@@ -2203,7 +2203,7 @@
         "__id__": 79
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 84
@@ -2723,6 +2723,9 @@
     "diamondLabel": {
       "__id__": 27
     },
+    "goldLabel": {
+      "__id__": 65
+    },
     "_id": ""
   },
   {

+ 3 - 0
assets/resources/ui/FightingUI.prefab

@@ -7276,6 +7276,9 @@
     "teachingNode": {
       "__id__": 102
     },
+    "DropBoxAnimation": {
+      "__id__": 231
+    },
     "_id": ""
   },
   {

+ 4 - 0
assets/scripts/games/models/GameModel.ts

@@ -32,6 +32,10 @@ export class GameModel extends DataModel {
      */
     currentWeaponCell: WeaponCell;
 
+    /**
+     * 上次空投的时间点
+     */
+    lastDropBoxTime:number=0;
     constructor() {
         super();
     }

+ 1 - 1
assets/scripts/games/ui/dropBox/DropBoxMediator.ts

@@ -129,7 +129,7 @@ export class DropBoxMediator extends GUIMediator {
     start () {
         // Your initialization goes here.
     }
-
+    
     // update (deltaTime: number) {
     //     // Your update function goes here.
     // }

+ 18 - 6
assets/scripts/games/ui/fightings/FightingMediator.ts

@@ -1,4 +1,5 @@
-import { ButtonComponent, EventTouch, GraphicsComponent, instantiate, LabelComponent, loader, Node, Prefab, ProgressBarComponent, SpriteComponent, SpriteFrame, _decorator } from 'cc';
+import { AnimationComponent, ButtonComponent, director, EventTouch, GraphicsComponent, instantiate, LabelComponent, loader, Node, Prefab, ProgressBarComponent, SpriteComponent, SpriteFrame, _decorator } from 'cc';
+import { GUIManager } from '../../../engines/gui/GUIManager';
 import { GUIMediator } from '../../../engines/gui/GUIMediator';
 import { LoadingView } from '../../../engines/loadingView/LoadingView';
 import { DataModelEventType } from '../../../engines/models/DataModelEventType';
@@ -7,6 +8,7 @@ import { SoundManager } from '../../../engines/sounds/SoundManager';
 import GameConfigManager from '../../models/GameConfigManager';
 import { GameModel } from '../../models/GameModel';
 import { GamePropertys } from '../../models/GamePropertys';
+import { UIConst } from '../UIConst';
 import { GameController } from './GameController';
 import { WeaponBase } from './weapons/WeaponBase';
 const { ccclass, property } = _decorator;
@@ -149,6 +151,11 @@ export class FightingMediator extends GUIMediator {
     })
     teachingNode:Node=null;
 
+    @property({
+        type:AnimationComponent
+    })
+    DropBoxAnimation:AnimationComponent=null;
+
     /**
      * 弹夹子弹池
      */
@@ -405,6 +412,13 @@ export class FightingMediator extends GUIMediator {
             return;
         }
         super.update(deltaTime);
+        //空投
+        let currentTime:number=director.getCurrentTime();
+        if(currentTime-GameModel.single.lastDropBoxTime>30000){
+            this.DropBoxAnimation.node.active=true;
+            this.DropBoxAnimation.play("KongtouTip");
+            GameModel.single.lastDropBoxTime=currentTime;
+        }
         if(GameController.single.fence!=null&&GameController.single.fence.node!=null){
             this.RefreshFenceHp();
             this.fenceHp=GameController.single.fence.hp;
@@ -483,11 +497,9 @@ export class FightingMediator extends GUIMediator {
      * 暂停游戏
      */
     pauseGame():void{
-        if(GameController.single.paused){
-            GameController.single.PlayGame();
-        }else{
-            GameController.single.PauseGame();
-        }
+        GameController.single.PauseGame();
+        this.DropBoxAnimation.node.active=false;
+        GUIManager.single.Show(UIConst.DROP_BOX_UI,true);
     }
 
     /**

+ 14 - 1
assets/scripts/games/ui/prepares/PrepareMediator.ts

@@ -1,4 +1,4 @@
-import { ButtonComponent, EventTouch, find, instantiate, LabelComponent, LayoutComponent, loader, ModelComponent, Node, Prefab, Quat, SpriteComponent, SpriteFrame, SystemEventType, Touch, Vec2, view, _decorator } from 'cc';
+import { AnimationComponent, ButtonComponent, EventTouch, find, instantiate, LabelComponent, LayoutComponent, loader, ModelComponent, Node, Prefab, Quat, SpriteComponent, SpriteFrame, SystemEventType, Touch, Vec2, view, _decorator } from 'cc';
 import BufferManager from '../../../engines/buffers/BufferManager';
 import IBuffer from '../../../engines/buffers/IBuffer';
 import { GUIManager } from '../../../engines/gui/GUIManager';
@@ -20,6 +20,11 @@ const { ccclass, property } = _decorator;
 @ccclass('PrepareMediator')
 export class PrepareMediator extends GUIMediator {
 
+    @property({
+        type:AnimationComponent
+    })
+    DropBoxAnimation:AnimationComponent=null;
+
     @property({
         type: Node
     })
@@ -473,6 +478,14 @@ export class PrepareMediator extends GUIMediator {
      */
     update(dt:number):void{
         super.update(dt);
+        //空投
+        let currentTime:number=director.getCurrentTime();
+        if(currentTime-GameModel.single.lastDropBoxTime>30000){
+            this.DropBoxAnimation.node.active=true;
+            this.DropBoxAnimation.play("KongtouTip");
+            GameModel.single.lastDropBoxTime=currentTime;
+        }
+
         //自动合成Buffer剩余时间
         let buffers:IBuffer[]=BufferManager.GetBufferGroup("AutoSynthesis");
         if(buffers!=null&&buffers.length>0){