woso_javan преди 2 месеца
родител
ревизия
4f2a2054cc

+ 166 - 9
assets/module_storm_sunder/Prefabs/Tornado.prefab

@@ -25,19 +25,26 @@
         "__id__": 11
       },
       {
-        "__id__": 13
+        "__id__": 17
       },
       {
-        "__id__": 15
+        "__id__": 19
       },
       {
-        "__id__": 17
+        "__id__": 21
+      },
+      {
+        "__id__": 23
       }
     ],
     "_active": true,
-    "_components": [],
+    "_components": [
+      {
+        "__id__": 25
+      }
+    ],
     "_prefab": {
-      "__id__": 19
+      "__id__": 27
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -261,6 +268,138 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "Radius",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 12
+      },
+      {
+        "__id__": 14
+      }
+    ],
+    "_prefab": {
+      "__id__": 16
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.RigidBody",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 11
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_group": 1,
+    "_type": 1,
+    "_mass": 1,
+    "_allowSleep": true,
+    "_linearDamping": 0.1,
+    "_angularDamping": 0.1,
+    "_useGravity": true,
+    "_linearFactor": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_angularFactor": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "060Xslm/NCXoJj1Q2AT3Ep"
+  },
+  {
+    "__type__": "cc.BoxCollider",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 11
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 15
+    },
+    "_material": null,
+    "_isTrigger": true,
+    "_center": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_size": {
+      "__type__": "cc.Vec3",
+      "x": 5,
+      "y": 1,
+      "z": 5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7eeq0rq4xD0Yk9Q82mkifL"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "deveaLAI9G347KGyKLScdE",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
   {
     "__type__": "cc.Node",
     "_name": "Point1",
@@ -273,7 +412,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 12
+      "__id__": 18
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -329,7 +468,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 14
+      "__id__": 20
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -385,7 +524,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 16
+      "__id__": 22
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -441,7 +580,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 18
+      "__id__": 24
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -485,6 +624,24 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
+  {
+    "__type__": "ec496/7E6NMGJmO1HwAGpzy",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 26
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "1dfwcaiA9MvKSIKkj+bQhj"
+  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {

+ 2 - 38
assets/module_storm_sunder/Prefabs/UI/Result/UI_BattleResult_Impl.ts

@@ -6,7 +6,6 @@ import { UI_BattleResult } from "../../../../scripts/UIDef";
 import { Layout_BattleResult } from "./Layout_BattleResult";
 import { GtagMgr, GtagType } from "db://assets/core_tgx/base/GtagMgr";
 import { GameEvent } from "../../../Script/Enum/GameEvent";
-import { LevelManager } from "../../../Script/Manager/LevelMgr";
 import { StormSunderAudioMgr } from "../../../Script/Manager/StormSunderAudioMgr";
 
 export class UI_BattleResult_Impl extends UI_BattleResult {
@@ -22,7 +21,7 @@ export class UI_BattleResult_Impl extends UI_BattleResult {
     }
 
     protected onCreated(): void {
-        this.win = LevelManager.instance.levelModel.isWin;
+        this.win = true
         const soundId = this.win ? 7 : 8;
         StormSunderAudioMgr.playOneShot(StormSunderAudioMgr.getMusicIdName(soundId), 1.0);
 
@@ -38,9 +37,8 @@ export class UI_BattleResult_Impl extends UI_BattleResult {
         layout.loseNode.active = !this.win;
 
         this.rotationLight();
-        this.refreshProgressBar();
 
-        const { level } = LevelManager.instance.levelModel;
+        const level = 1
         GtagMgr.inst.doGameDot(GtagType.level_end, { level }); //上报关卡结束
     }
 
@@ -62,13 +60,10 @@ export class UI_BattleResult_Impl extends UI_BattleResult {
     private emitEvent(): void {
         if (this.win) {
             EventDispatcher.instance.emit(GameEvent.EVENT_BATTLE_SUCCESS_LEVEL_UP);
-        } else {
-            EventDispatcher.instance.emit(GameEvent.EVENT_BATTLE_FAIL_LEVEL_RESET);
         }
     }
 
     onClickRewardBase(): void {
-        this.destoryMyself();
         this.emitEvent();
     }
 
@@ -76,37 +71,6 @@ export class UI_BattleResult_Impl extends UI_BattleResult {
         this.timeoutIds.forEach((id) => clearTimeout(id));
         this.timeoutIds = [];
     }
-
-    //刷新进度条
-    private refreshProgressBar(): void {
-        const { winLevProgress, loseLevProgress } = this.layout;
-
-        if (this.win) {
-            winLevProgress.progress = 1;
-            winLevProgress.node.getChildByName('Label').getComponent(Label).string = '100%';
-        } else {
-            const wineglass = LevelManager.instance.levelModel.levelConfig.wineglass;
-            const sum = wineglass.reduce((pre, cur) => pre + cur, 0);
-            const remainCupCount = LevelManager.instance.levelModel.remainCupCount;
-            // const progress = ~~((sum - remainCupCount) / sum * 100) / 100;
-            // loseLevProgress.progress = Math.floor(progress * 100) / 100;
-            // const progressStr = (progress * 100).toFixed(2);
-
-            const progress = (sum - remainCupCount) / sum;
-            loseLevProgress.progress = progress;
-            const progressStr = (progress * 100).toFixed(2);
-            loseLevProgress.node.getChildByName('Label').getComponent(Label).string = progressStr + '%';
-        }
-    }
-
-    private destoryMyself(): void {
-        Tween.stopAllByTarget(this.node)
-        if (isValid(this.node)) {
-            this.node.removeFromParent();
-            this.hide();
-        }
-        this.clearAllTimeouts();
-    }
 }
 
 tgxModuleContext.attachImplClass(UI_BattleResult, UI_BattleResult_Impl);

+ 0 - 7
assets/module_storm_sunder/RoosterStormSunder.ts

@@ -31,7 +31,6 @@ export class RoosterStormSunder extends Component {
         const btnSet = StormSunderGlobalInstance.instance.btnSet;
         const btnStart = StormSunderGlobalInstance.instance.btnStart;
 
-        btnRefresh.on(NodeEventType.TOUCH_END, () => this.onClickRefresh(), this);
         btnSet.on(NodeEventType.TOUCH_END, () => this.onClickSet(), this);
         btnStart.on(NodeEventType.TOUCH_END, () => this.onClickStart(), this);
     }
@@ -43,12 +42,6 @@ export class RoosterStormSunder extends Component {
         battleUI.active = true;
     }
 
-    private async onClickRefresh(): Promise<void> {
-        StormSunderAudioMgr.playOneShot(StormSunderAudioMgr.getMusicIdName(2), 1.0);
-        Tween.stopAll();
-        EventDispatcher.instance.emit(GameEvent.EVENT_BATTLE_FAIL_LEVEL_RESET);
-    }
-
     private onClickSet(): void {
         StormSunderAudioMgr.playOneShot(StormSunderAudioMgr.getMusicIdName(2), 1.0);
         const show = tgxUIMgr.inst.isShowing(UI_Setting);

+ 81 - 0
assets/module_storm_sunder/Script/Component/CharacterComponent.ts

@@ -0,0 +1,81 @@
+import { Button, Component, ConeCollider, CylinderCollider, ITriggerEvent, Label, Node, NodeEventType, SphereCollider, Vec3, _decorator, find, game } from 'cc';
+import { StormSunderAudioMgr } from '../Manager/StormSunderAudioMgr';
+import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
+import { GameEvent } from '../Enum/GameEvent';
+import { UIJoyStick } from '../UIJoyStick';
+const { ccclass, property } = _decorator;
+
+/** 龙卷风组件*/
+@ccclass('TornadoComponent')
+export class TornadoComponent extends Component {
+    tigger: ConeCollider = null!; //龙卷风触发器
+    radiusTigger: ConeCollider = null!;     //龙卷风半径检测触发器
+
+    attack: number = 1;
+    speed: number = 50;
+    ai: boolean = false;
+
+    protected start(): void {
+        this.initilizeUI();
+        this.registerEvent();
+    }
+
+    initilizeUI(): void {
+        this.tigger = this.node.getComponent('Tornado').getComponent(ConeCollider)!;
+        console.log('this.tigger', this.tigger);
+        this.tigger.on('onTriggerEnter', this.onTriggerEnter, this);
+    }
+
+    onTriggerEnter(event: ITriggerEvent): void {
+        const selfCollider = event.selfCollider as SphereCollider;
+        const otherCollider = event.otherCollider as CylinderCollider;
+        const radius = otherCollider.radius;
+
+        if (event.otherCollider.getGroup() == 1 << 6) {
+
+        }
+    }
+
+    update(deltaTime: number) {
+        this.MoveHandler();
+        //自身旋转
+        this.RotateHandler();
+    }
+
+    RotateHandler(): void {
+        const rotateSpeed = 500;
+        this.node.eulerAngles = new Vec3(this.node.eulerAngles.x, this.node.eulerAngles.y + rotateSpeed * game.deltaTime, this.node.eulerAngles.z);
+        // console.log('this.node.eulerAngles:', this.node.eulerAngles);
+    }
+
+    MoveHandler(): void {
+        const playerDir = UIJoyStick.ins.dir;
+        const playerX = playerDir.x * this.speed * game.deltaTime;
+        const playerZ = playerDir.y * this.speed * game.deltaTime;
+
+        this.node.setPosition(this.node.position.x - playerX, 5, this.node.position.z + playerZ);
+    }
+
+
+    protected registerEvent() {
+        EventDispatcher.instance.on(GameEvent.EVENT_STORM_LEVEL_UP, this.stormLevelUp, this);
+    }
+
+    private stormLevelUp() {
+
+        //DOTO  计算攻击速度等属性
+        this.attack = 1;
+        this.speed = 1;
+
+        //DOTO 更新UI
+    }
+
+    protected onDestroy(): void {
+        this.unregisterEvent();
+    }
+
+    protected unregisterEvent() {
+        EventDispatcher.instance.off(GameEvent.EVENT_STORM_LEVEL_UP, this.stormLevelUp, this);
+    }
+
+}

+ 9 - 0
assets/module_storm_sunder/Script/Component/CharacterComponent.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "ec496ffb-13a3-4c18-998e-d47c001a9cf2",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 2 - 29
assets/module_storm_sunder/Script/Enum/GameEvent.ts

@@ -4,39 +4,12 @@ export class GameEvent {
     /** 游戏开始*/
     static readonly EVENT_GAME_START = 'EVENT_GAME_START';
 
-    /** 点击原浆酒杯*/
-    static readonly EVENT_CLICK_ORIGIN_CUP = 'EVENT_CLICK_ORIGIN_CUP';
-
-    /** 刷新钉子颜色事件*/
-    static readonly EVENT_REFRESH_PIN_COLORS = 'EVENT_REFRESH_PIN_COLORS';
-
-    /** 按钮功能 颜色刷新事件*/
-    static readonly EVENT_REFRESH_COLOR = 'EVENT_REFRESH_COLOR';
-
-    /** 按钮功能 移出事件*/
-    static readonly EVENT_MOVE_OUT = 'EVENT_MOVE_OUT';
-
-    /** 按钮功能 补满事件*/
-    static readonly EVENT_FILL_UP = 'EVENT_FILL_UP';
-
-    /** 右侧杯子已补满*/
-    static readonly EVENT_RIGHT_CUP_FULL = 'EVENT_RIGHT_CUP_FULL';
+    /** 龙卷风升级*/
+    static readonly EVENT_STORM_LEVEL_UP = 'EVENT_STORM_LEVEL_UP';
 
     /** 检测游戏是否结束*/
     static readonly EVENT_CHECK_GAME_OVER = 'EVENT_CHECK_GAME_OVER';
 
     /** 闯关成功 关卡升级*/
     static readonly EVENT_BATTLE_SUCCESS_LEVEL_UP = 'EVENT_BATTLE_SUCCESS_LEVEL_UP';
-
-    /** 闯关失败 关卡重载*/
-    static readonly EVENT_BATTLE_FAIL_LEVEL_RESET = 'EVENT_BATTLE_FAIL_LEVEL_RESET';
-
-    /** 原浆杯销毁*/
-    static readonly EVENT_ORIGIN_CUP_DESTROYED = 'EVENT_ORIGIN_CUP_DESTROYED';
-
-    /** 调酒杯销毁*/
-    static readonly EVENT_COCKTAIL_CUP_DESTROYED = 'EVENT_COCKTAIL_CUP_DESTROYED';
-
-    /** 刷新剩余杯*/
-    static readonly EVENT_REFRESH_REMAIN_CUP = 'EVENT_REFRESH_REMAIN_CUP';
 }

+ 0 - 7
assets/module_storm_sunder/Script/LevelAction.ts

@@ -1,6 +1,5 @@
 import { _decorator, BoxCollider2D, Button, CircleCollider2D, Collider2D, Component, find, instantiate, Node, NodeEventType, tween, view, Vec3, mat4, UITransform, Label } from 'cc';
 import { tgxUIAlert, tgxUIMgr, tgxUITips } from '../../core_tgx/tgx';
-import { LevelManager } from './Manager/LevelMgr';
 
 import { GtagMgr, GtagType } from '../../core_tgx/base/GtagMgr';
 import { GlobalConfig } from '../../start/Config/GlobalConfig';
@@ -23,13 +22,7 @@ export class LevelAction extends Component {
 
     //上报信息
     reportInformation() {
-        const { level } = LevelManager.instance.levelModel;
-        console.log(`上报信息 level:${level}`);
-        GtagMgr.inst.doGameDot(GtagType.level_start, { level });
 
-        if (!GlobalConfig.isDebug) {
-            AdvertMgr.instance.showInterstitial();
-        }
     }
 
     onDestroy() {

Файловите разлики са ограничени, защото са твърде много
+ 163 - 139
assets/module_storm_sunder/rooster_stormsunder.scene


Някои файлове не бяха показани, защото твърде много файлове са промени