瀏覽代碼

射击提示

greg 4 年之前
父節點
當前提交
c5fc4565fe

文件差異過大導致無法顯示
+ 202 - 101
assets/resources/configs/Levels.json


文件差異過大導致無法顯示
+ 511 - 221
assets/resources/ui/FightingUI.prefab


+ 1 - 0
assets/scripts/games/models/GameConfigManager.ts

@@ -352,6 +352,7 @@ export default class GameConfigManager
                     monsterConfig.damage=element.damage;
                     monsterConfig.anger=element.anger;
                     monsterConfig.integral=element.integral;
+                    monsterConfig.fireTip=element.fireTip;
                     if(element.startPosType==1){
                         let r:number=Math.random()*9;
                         if(r<3){

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

@@ -149,7 +149,17 @@ export class FightingMediator extends GUIMediator {
     @property({
         type:Node
     })
-    teachingNode:Node=null;
+    BowLeft:Node=null;
+
+    @property({
+        type:Node
+    })
+    BowMid:Node=null;
+
+    @property({
+        type:Node
+    })
+    BowRight:Node=null;
 
     @property({
         type:AnimationComponent
@@ -181,12 +191,10 @@ export class FightingMediator extends GUIMediator {
 
     OnShow():void{
         this.onShowed=false;
+        this.BowLeft.active=false;
+        this.BowMid.active=false;
+        this.BowRight.active=false;
         this.LoadAssets();
-        if(GameModel.single.isNewPlayer){
-            this.teachingNode.active=true;
-        }else{
-            this.teachingNode.active=false;
-        }
     }
 
     private __OnShow():void{
@@ -433,13 +441,14 @@ export class FightingMediator extends GUIMediator {
             this.reloadProgrssBar.node.active=true;
             this.reloadProgrssBar.progress=GameController.single.weapon.reloadProgress;
         }
+        //射击提示
+        this.BowLeft.active=GameController.single.FireTip(1);
+        this.BowMid.active=GameController.single.FireTip(2);
+        this.BowRight.active=GameController.single.FireTip(3);
     }
 
     private currentFireButtonNode:Node;
     FireButtonTouchStart(e:EventTouch):void{
-        if(this.teachingNode.active){
-            this.teachingNode.active=false;
-        }
         this.currentFireButtonNode=e.target as Node;
         if(e.target==this.leftFireButton.node){
             GameController.single.TryFire(1);

+ 31 - 0
assets/scripts/games/ui/fightings/GameController.ts

@@ -579,6 +579,37 @@ export class GameController extends EventDispatcher{
         return new SingleShotWeapon(leftHand,rightHand);;
     }
 
+    /**
+     * 判断是否需要提示射击
+
+     */
+    FireTip(type:number):boolean{
+        switch (type) {
+            case 1:
+                this.leftMonsterList.forEach(element => {
+                    if(element.monsterConfig.fireTip>0){
+                        return true;
+                    }
+                });
+                break;
+            case 2:
+                this.middleMonsterList.forEach(element => {
+                    if(element.monsterConfig.fireTip>0){
+                        return true;
+                    }
+                });
+                break;
+            case 3:
+                this.rightMonsterList.forEach(element => {
+                    if(element.monsterConfig.fireTip>0){
+                        return true;
+                    }
+                });
+                break;
+        }
+        return false;
+    }
+
     get scene(){
         return director.getScene();
     }

部分文件因文件數量過多而無法顯示