瀏覽代碼

HomeUI 外围按钮初始化

woso_javan 2 月之前
父節點
當前提交
5022b59ef1
共有 34 個文件被更改,包括 2304 次插入189 次删除
  1. 1 0
      assets/module_basic/config/ai_config.json
  2. 11 0
      assets/module_basic/config/ai_config.json.meta
  3. 1 0
      assets/module_basic/config/ainame_config.json
  4. 11 0
      assets/module_basic/config/ainame_config.json.meta
  5. 23 0
      assets/module_basic/config/develop_config.json
  6. 11 0
      assets/module_basic/config/develop_config.json.meta
  7. 1 0
      assets/module_basic/config/item_config.json
  8. 11 0
      assets/module_basic/config/item_config.json.meta
  9. 1 1
      assets/module_basic/config/main_config.json
  10. 1 0
      assets/module_basic/config/map_config.json
  11. 11 0
      assets/module_basic/config/map_config.json.meta
  12. 1 1
      assets/module_basic/config/music_config.json
  13. 55 0
      assets/module_basic/table/Tableai_config.ts
  14. 9 0
      assets/module_basic/table/Tableai_config.ts.meta
  15. 23 0
      assets/module_basic/table/Tableainame_config.ts
  16. 9 0
      assets/module_basic/table/Tableainame_config.ts.meta
  17. 38 0
      assets/module_basic/table/Tabledevelop_config.ts
  18. 9 0
      assets/module_basic/table/Tabledevelop_config.ts.meta
  19. 71 0
      assets/module_basic/table/Tableitem_config.ts
  20. 9 0
      assets/module_basic/table/Tableitem_config.ts.meta
  21. 39 0
      assets/module_basic/table/Tablemap_config.ts
  22. 9 0
      assets/module_basic/table/Tablemap_config.ts.meta
  23. 2 1
      assets/module_storm_sunder/RoosterStormSunder.ts
  24. 40 8
      assets/module_storm_sunder/Script/Component/ButtonComponent.ts
  25. 30 0
      assets/module_storm_sunder/Script/Manager/AttributeBonusMgr.ts
  26. 9 0
      assets/module_storm_sunder/Script/Manager/AttributeBonusMgr.ts.meta
  27. 36 0
      assets/module_storm_sunder/Script/Model/DevelopConfigModel.ts
  28. 9 0
      assets/module_storm_sunder/Script/Model/DevelopConfigModel.ts.meta
  29. 40 29
      assets/module_storm_sunder/Script/Model/UserModel.ts
  30. 0 6
      assets/module_storm_sunder/Script/StormSunderGlobalInstance.ts
  31. 二進制
      assets/module_storm_sunder/Textures/money.png
  32. 134 0
      assets/module_storm_sunder/Textures/money.png.meta
  33. 1648 142
      assets/module_storm_sunder/rooster_stormsunder.scene
  34. 1 1
      assets/start/Start.ts

+ 1 - 0
assets/module_basic/config/ai_config.json

@@ -0,0 +1 @@
+{"1":{"text":"乱跑","range":100,"move_judge":90,"move_time":[3,6],"escape_time":[3,6],"pursuit_1":30,"pursuit_2":30,"pursuit_time":[3,6],"weight":20},"2":{"text":"苟","range":100,"move_judge":50,"move_time":[3,6],"escape_time":[3,6],"pursuit_1":10,"pursuit_2":10,"pursuit_time":[3,6],"weight":10},"3":{"text":"疯狗","range":100,"move_judge":10,"move_time":[3,6],"escape_time":[3,6],"pursuit_1":90,"pursuit_2":50,"pursuit_time":[3,6],"weight":5}}

+ 11 - 0
assets/module_basic/config/ai_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "decd5ff6-cb7c-49e0-985f-016a665c4219",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 0
assets/module_basic/config/ainame_config.json

@@ -0,0 +1 @@
+{"1":{"text":"Aurora"},"2":{"text":"Flechaz0"},"3":{"text":"Lsland"},"4":{"text":"Beloved"},"5":{"text":"Monologue"},"6":{"text":"Outlier"},"7":{"text":"camellia"},"8":{"text":"Serein"},"9":{"text":"Neflibata"},"10":{"text":"Tsuki"},"11":{"text":"Dreamboat"},"12":{"text":"Pianeer"},"13":{"text":"Yalo"},"14":{"text":"Coisini"},"15":{"text":"Solitude"},"16":{"text":"Hperpetua"}}

+ 11 - 0
assets/module_basic/config/ainame_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "1b757cfd-c8a8-4998-8ac7-1b355b379533",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 23 - 0
assets/module_basic/config/develop_config.json

@@ -0,0 +1,23 @@
+{
+    "1": {
+        "property_type": 1,
+        "base": 0,
+        "up_value": 1,
+        "base_currency": 350,
+        "money_growth": 350
+    },
+    "2": {
+        "property_type": 2,
+        "base": 0,
+        "up_value": 1,
+        "base_currency": 450,
+        "money_growth": 450
+    },
+    "3": {
+        "property_type": 3,
+        "base": 0,
+        "up_value": 10,
+        "base_currency": 400,
+        "money_growth": 400
+    }
+}

+ 11 - 0
assets/module_basic/config/develop_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "612fd3cb-c259-4750-bc83-5f695bca8407",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 0
assets/module_basic/config/item_config.json

@@ -0,0 +1 @@
+{"1":{"name":"羊","model":"yang","move":1,"speed":10,"move_judge":50,"time":[2,10],"regeneration":1,"number_basic":20,"regeneration_time":[10,20],"regeneration_number":[20,30],"limit":100,"hp":2,"exp":2},"2":{"name":"牛","model":"niu","move":1,"speed":10,"move_judge":50,"time":[2,10],"regeneration":1,"number_basic":20,"regeneration_time":[10,20],"regeneration_number":[20,30],"limit":100,"hp":4,"exp":4},"3":{"name":"建筑1","model":"jianzhu_1","move":0,"speed":0,"move_judge":0,"time":[],"regeneration":0,"number_basic":0,"regeneration_time":[],"regeneration_number":[],"limit":0,"hp":10,"exp":10},"4":{"name":"建筑2","model":"jianzhu_2","move":0,"speed":0,"move_judge":0,"time":[],"regeneration":0,"number_basic":0,"regeneration_time":[],"regeneration_number":[],"limit":0,"hp":20,"exp":20}}

+ 11 - 0
assets/module_basic/config/item_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "66a5079e-5a76-47a3-90e4-969a70fb84d4",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 1
assets/module_basic/config/main_config.json

@@ -1 +1 @@
-{"1":{"param":5,"content":"加时弹窗获得的时间,单位秒"},"2":{"param":2,"content":"吸力范围,填黑洞当前直径的倍数"}}
+{"1":{"param":5,"content":"强制弹窗广告间隔游玩次数"},"2":{"param":5000,"content":"观看广告获得货币的数量"},"3":{"param":20,"content":"龙卷风基础高度"},"4":{"param":1,"content":"每获得1经验提升的高度值"},"5":{"param":5,"content":"基础攻击力"},"6":{"param":5,"content":"每次升级提升的攻击力"},"7":{"param":2,"content":"每秒攻击次数"},"8":{"param":20,"content":"基础移动速度"},"9":{"param":1,"content":"每次升级提升的移动速度"},"10":{"param":10,"content":"等级为1时被吸收基础提供经验值"},"11":{"param":10,"content":"每次升级时提升的提供经验值"},"12":{"param":1,"content":"龙卷风基础模型体积"},"13":{"param":50,"content":"每次升级时提升体型的百分比,此数值在每次升级时加算,即 体积=基础体积×(1+等级×百分比)"},"14":{"param":50,"content":"开局弹窗提升的龙卷风破坏范围百分比"},"15":{"param":null,"content":"AI属性等级对比玩家属性等级浮动值,用一个负数到正数的区间表示"},"16":{"param":400,"content":"基础通关奖励"},"17":{"param":50,"content":"奖励养成属性加成百分比"},"18":{"param":5,"content":"奖励排名减益百分比"},"19":{"param":3,"content":"通过多倍奖励倍率"}}

+ 1 - 0
assets/module_basic/config/map_config.json

@@ -0,0 +1 @@
+{"1":{"text":"地图1","time":90,"name":"map_1","item":[1,2],"number":15}}

+ 11 - 0
assets/module_basic/config/map_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "8a250bef-4631-4ea8-aedc-9c0a54097b6b",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 1
assets/module_basic/config/music_config.json

@@ -1 +1 @@
-{"1":{"name":"bgm","type":1,"cd":0,"content":"背景音乐"},"2":{"name":"dianji","type":2,"cd":0,"content":"UI按钮点击音效"},"3":{"name":"dianjiliangbei","type":2,"cd":0,"content":"点击量杯音效"},"4":{"name":"daoshui","type":2,"cd":0,"content":"倒水音效"},"5":{"name":"daoman","type":2,"cd":0,"content":"倒满调酒杯音效"},"6":{"name":"shuaxin","type":2,"cd":0,"content":"量杯刷新音效"},"7":{"name":"shengli","type":2,"cd":0,"content":"胜利"},"8":{"name":"shibai","type":2,"cd":0,"content":"失败"},"9":{"name":"suilie","type":2,"cd":0,"content":"冰块碎裂"}}
+{"1":{"name":"bgm","type":1,"cd":0,"content":"背景音乐,只在游戏中播放"},"2":{"name":"dianji","type":2,"cd":0,"content":"UI按钮点击音效"},"3":{"name":"shengji","type":2,"cd":0,"content":"升级音效"},"4":{"name":"pohuai","type":2,"cd":0,"content":"摧毁物品音效"},"5":{"name":"xishou","type":2,"cd":0,"content":"吸收龙卷风音效"},"6":{"name":"shengli","type":2,"cd":0,"content":"胜利音效"},"7":{"name":"shibai","type":2,"cd":0,"content":"失败音效"}}

+ 55 - 0
assets/module_basic/table/Tableai_config.ts

@@ -0,0 +1,55 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tableai_config {
+    static TableName: string = "ai_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tableai_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 备注 */
+    get text(): string {
+        return this.data.text;
+    }
+    /** 检测半径 */
+    get range(): number {
+        return this.data.range;
+    }
+    /** 移动概率 */
+    get move_judge(): number {
+        return this.data.move_judge;
+    }
+    /** 移动周期 */
+    get move_time(): any {
+        return this.data.move_time;
+    }
+    /** 逃跑周期 */
+    get escape_time(): any {
+        return this.data.escape_time;
+    }
+    /** 追击概率 */
+    get pursuit_1(): number {
+        return this.data.pursuit_1;
+    }
+    /** 二次判读追击概率 */
+    get pursuit_2(): number {
+        return this.data.pursuit_2;
+    }
+    /** 追击周期 */
+    get pursuit_time(): any {
+        return this.data.pursuit_time;
+    }
+    /** 匹配权重 */
+    get weight(): number {
+        return this.data.weight;
+    }
+}
+    

+ 9 - 0
assets/module_basic/table/Tableai_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "fe176d81-9ad4-4526-a193-d12b30b5911d",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 23 - 0
assets/module_basic/table/Tableainame_config.ts

@@ -0,0 +1,23 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tableainame_config {
+    static TableName: string = "ainame_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tableainame_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 名字 */
+    get text(): string {
+        return this.data.text;
+    }
+}
+    

+ 9 - 0
assets/module_basic/table/Tableainame_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "165230a5-1aba-4603-9895-ef4a55b6802e",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 38 - 0
assets/module_basic/table/Tabledevelop_config.ts

@@ -0,0 +1,38 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tabledevelop_config {
+    static TableName: string = "develop_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tabledevelop_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 属性类型 */
+    get property_type(): number {
+        return this.data.property_type;
+    }
+    /** 属性基础值 */
+    get base(): number {
+        return this.data.base;
+    }
+    /** 属性提升值 */
+    get up_value(): number {
+        return this.data.up_value;
+    }
+    /** 升级基础货币 */
+    get base_currency(): number {
+        return this.data.base_currency;
+    }
+    /** 货币增长 */
+    get money_growth(): number {
+        return this.data.money_growth;
+    }
+}

+ 9 - 0
assets/module_basic/table/Tabledevelop_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "f9120c91-df6c-441f-b3e7-bc174e5f5611",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 71 - 0
assets/module_basic/table/Tableitem_config.ts

@@ -0,0 +1,71 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tableitem_config {
+    static TableName: string = "item_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tableitem_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 备注 */
+    get name(): string {
+        return this.data.name;
+    }
+    /** 模型 */
+    get model(): string {
+        return this.data.model;
+    }
+    /** 是否移动 */
+    get move(): number {
+        return this.data.move;
+    }
+    /** 移动速度 */
+    get speed(): number {
+        return this.data.speed;
+    }
+    /** 移动概率 */
+    get move_judge(): number {
+        return this.data.move_judge;
+    }
+    /** 行为周期 */
+    get time(): any {
+        return this.data.time;
+    }
+    /** 是否再生 */
+    get regeneration(): number {
+        return this.data.regeneration;
+    }
+    /** 初始生成数量 */
+    get number_basic(): number {
+        return this.data.number_basic;
+    }
+    /** 再生周期 */
+    get regeneration_time(): any {
+        return this.data.regeneration_time;
+    }
+    /** 再生数量 */
+    get regeneration_number(): any {
+        return this.data.regeneration_number;
+    }
+    /** 数量上限 */
+    get limit(): number {
+        return this.data.limit;
+    }
+    /** 血量 */
+    get hp(): number {
+        return this.data.hp;
+    }
+    /** 经验 */
+    get exp(): number {
+        return this.data.exp;
+    }
+}
+    

+ 9 - 0
assets/module_basic/table/Tableitem_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "4b64297f-6947-4bd0-9666-ba5dbebeea6e",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 39 - 0
assets/module_basic/table/Tablemap_config.ts

@@ -0,0 +1,39 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tablemap_config {
+    static TableName: string = "map_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tablemap_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 备注信息 */
+    get text(): string {
+        return this.data.text;
+    }
+    /** 游戏时长 */
+    get time(): number {
+        return this.data.time;
+    }
+    /** 场景文件 */
+    get name(): string {
+        return this.data.name;
+    }
+    /** 可生成物编号 */
+    get item(): any {
+        return this.data.item;
+    }
+    /** 玩家数 */
+    get number(): number {
+        return this.data.number;
+    }
+}
+    

+ 9 - 0
assets/module_basic/table/Tablemap_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "f85ec44f-b59f-4cd7-914c-24b3fdc905fa",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 2 - 1
assets/module_storm_sunder/RoosterStormSunder.ts

@@ -8,13 +8,14 @@ import { tgxUIMgr } from '../core_tgx/tgx';
 import { UI_Setting } from '../scripts/UIDef';
 import { StormSunderAudioMgr } from './Script/Manager/StormSunderAudioMgr';
 import { GameMgr, GameStatus } from './Script/Manager/GameMgr';
-import { TimerMgr } from './Script/Manager/TimerMgr';
+import { AttributeBonusMgr } from './Script/Manager/AttributeBonusMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('RoosterStormSunder')
 export class RoosterStormSunder extends Component {
 
     onLoad() {
+        AttributeBonusMgr.inst.initilize();
         StormSunderAudioMgr.initilize();
         StormSunderAudioMgr.play(StormSunderAudioMgr.getMusicIdName(1), 1.0);
     }

+ 40 - 8
assets/module_storm_sunder/Script/Component/ButtonComponent.ts

@@ -3,9 +3,9 @@ import { GameEvent } from '../Enum/GameEvent';
 import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
 import { GlobalConfig } from 'db://assets/start/Config/GlobalConfig';
 import { AdvertMgr } from 'db://assets/core_tgx/base/ad/AdvertMgr';
-import { TYPE_ITEM } from '../StormSunderGlobalInstance';
 import { tgxUIAlert } from 'db://assets/core_tgx/tgx';
 import { StormSunderAudioMgr } from '../Manager/StormSunderAudioMgr';
+import { AttributeBonusMgr, BonusType } from '../Manager/AttributeBonusMgr';
 const { ccclass, property } = _decorator;
 
 /**
@@ -13,23 +13,55 @@ const { ccclass, property } = _decorator;
  */
 @ccclass('ButtonComponent')
 export class ButtonComponent extends Component {
-    @property(Button) btnFillUp: Button = null!;
-    @property(Button) btMoveOut: Button = null!;
-    @property(Button) btRefresh: Button = null!;
+    @property(Button) btnAttack: Button = null!;
+    @property(Button) btSpeed: Button = null!;
+    @property(Button) btExp: Button = null!;
 
     protected start(): void {
         this.addUIEvent();
+        this.updateBtView(BonusType.ATTACK);
+        this.updateBtView(BonusType.SPEED);
+        this.updateBtView(BonusType.EXP);
     }
 
     private addUIEvent(): void {
-        this.btnFillUp.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(TYPE_ITEM.UP_ATTACK), this);
-        this.btMoveOut.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(TYPE_ITEM.UP_SPEED), this);
-        this.btRefresh.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(TYPE_ITEM.UP_EXP), this);
+        this.btnAttack.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(BonusType.ATTACK), this);
+        this.btSpeed.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(BonusType.SPEED), this);
+        this.btExp.node.on(NodeEventType.TOUCH_END, () => this.onClickHandler(BonusType.EXP), this);
     }
 
-    private onClickHandler(type: TYPE_ITEM): void {
+    private onClickHandler(type: BonusType): void {
         console.log("onClickHandler", type);
         StormSunderAudioMgr.playOneShot(StormSunderAudioMgr.getMusicIdName(2), 1.0);
     }
 
+    private updateBtView(type: BonusType, max?: boolean): void {
+        const { userModel } = AttributeBonusMgr.inst;
+        const { bonusData } = userModel;
+        const buttonNode = this.getButtonNodeByType(type);
+
+        const lbLevel: Label = buttonNode.getChildByName('LbLv').getComponent(Label)!;
+        const useddMoney = buttonNode.getChildByName('UsedMoney')!;
+        const usedAd = buttonNode.getChildByName('UsedAd')!;
+        const lbMoney: Label = useddMoney.getChildByName('LbAmount').getComponent(Label)!;
+
+        if (max) {
+            lbLevel.string = 'MAX';
+            useddMoney.active = false;
+            usedAd.active = false;
+        } else {
+            const bonus = bonusData[type];
+            lbLevel.string = `LV.${bonus.level}`;
+            lbMoney.string = `${bonus.upgradeCost}`;
+        }
+    }
+
+    private getButtonNodeByType(type: BonusType): Node {
+        return {
+            [BonusType.ATTACK]: this.btnAttack.node,
+            [BonusType.SPEED]: this.btSpeed.node,
+            [BonusType.EXP]: this.btExp.node,
+        }[type];
+    }
+
 }

+ 30 - 0
assets/module_storm_sunder/Script/Manager/AttributeBonusMgr.ts

@@ -0,0 +1,30 @@
+import { Tableai_config } from "db://assets/module_basic/table/Tableai_config";
+import { DevelopConfigModel } from "../Model/DevelopConfigModel";
+import { UserModel } from "../Model/UserModel";
+
+/** 属性加成管理器*/
+export class AttributeBonusMgr {
+    private static _instance: AttributeBonusMgr;
+    public static get inst(): AttributeBonusMgr {
+        if (this._instance == null) {
+            this._instance = new AttributeBonusMgr();
+        }
+        return this._instance;
+    }
+
+    userModel: UserModel;
+    developConfig: DevelopConfigModel;
+
+    initilize() {
+        this.userModel = new UserModel();
+        this.developConfig = new DevelopConfigModel();
+        this.userModel.initialize();
+    }
+}
+
+//属性加成类型
+export enum BonusType {
+    ATTACK = 1,
+    SPEED = 2,
+    EXP = 3,
+}

+ 9 - 0
assets/module_storm_sunder/Script/Manager/AttributeBonusMgr.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "671dc21f-0b5e-41be-92b3-9b733b4ee671",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 36 - 0
assets/module_storm_sunder/Script/Model/DevelopConfigModel.ts

@@ -0,0 +1,36 @@
+import { Tabledevelop_config } from "db://assets/module_basic/table/Tabledevelop_config";
+/**
+ * 外部配置数据
+*/
+export class DevelopConfigModel {
+    private config: Tabledevelop_config;
+
+    constructor() {
+        this.config = new Tabledevelop_config();
+    }
+
+    getConfigById(id: number) {
+        this.config.init(id);
+        return this.config;
+    }
+
+    /** 属性基础值*/
+    get base(): number {
+        return this.config.base;
+    }
+
+    /** 属性提升值*/
+    get up_value(): number {
+        return this.config.up_value;
+    }
+
+    /** 升级基础货币*/
+    get base_currency(): number {
+        return this.config.base_currency;
+    }
+
+    /** 货币增长*/
+    get money_growth(): number {
+        return this.config.money_growth;
+    }
+}

+ 9 - 0
assets/module_storm_sunder/Script/Model/DevelopConfigModel.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "6fd4f6af-9857-467a-a713-b6331deec783",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 40 - 29
assets/module_storm_sunder/Script/Model/UserModel.ts

@@ -1,44 +1,55 @@
+import { AttributeBonusMgr, BonusType } from "../Manager/AttributeBonusMgr";
+
 /**玩家数据模型
  * @param attack 攻击力
  * @param money 金币
  * @param expPower 经验加成
 */
 export class UserModel {
-    private _attack: number = 1; //基础攻击
-    private _speed: number = 1; //基础速度
-    private _expPower: number = 1; //经验加成
-    private _money: number = 10000;
-    private _nickName: string = '落山鸡';
+    money: number = 9999;
+    nickName: string = '爸爸在此'; //昵称
+
+    game_attack: number = 1; //游戏内攻击力
+    game_speed: number = 1; //游戏内速度
+    game_modleVolume: number = 1; //模型体积
+
+    external_attack: number = 0; //外部攻击力加成
+    external_attack_lv: number = 1; //外部攻击力等级
+    external_attack_needMoney: number = 0; //升级需要金额
+
+    external_expPower_lv: number = 1; //外部经验加成等级
+    external_expPower: number = 0; //外部经验加成
+    external_expPower_needMoney: number = 0; //升级需要金额
+
+    external_speed_lv: number = 1; //外部经验加成等级
+    external_speed: number = 0; //外部速度加成
+    external_speed_needMoney: number = 0; //升级需要金额
+
+    bonusData: Record<BonusType, BonusItem> = null;
 
     constructor() {
     }
 
-    public get money(): number {
-        return this._money;
-    }
-    public set money(value: number) {
-        this._money = value;
-    }
+    initialize() {
 
-    public get nickName(): string {
-        return this._nickName;
-    }
-    public set nickName(value: string) {
-        this._nickName = value;
-    }
+        this.external_attack_needMoney = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.ATTACK).base_currency;
+        this.external_speed_needMoney = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.SPEED).base_currency;
+        this.external_expPower_needMoney = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.EXP).base_currency;
 
-    public get attack(): number {
-        return this._attack;
-    }
-    public set attack(value: number) {
-        this._attack = value;
-    }
+        this.external_attack = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.ATTACK).base;
+        this.external_speed = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.SPEED).base_currency;
+        this.external_expPower = AttributeBonusMgr.inst.developConfig.getConfigById(BonusType.EXP).base_currency;
 
-    public get speed(): number {
-        return this._speed;
+        this.bonusData = {
+            [BonusType.ATTACK]: { level: 1, upgradeCost: this.external_attack_needMoney },
+            [BonusType.SPEED]: { level: 1, upgradeCost: this.external_speed_needMoney },
+            [BonusType.EXP]: { level: 1, upgradeCost: this.external_expPower_needMoney },
+        };
     }
+}
 
-    public set speed(value: number) {
-        this._speed = value;
-    }
-}
+// 定义 Bonus 数据结构
+interface BonusItem {
+    level: number;
+    upgradeCost: number;
+}

+ 0 - 6
assets/module_storm_sunder/Script/StormSunderGlobalInstance.ts

@@ -52,11 +52,5 @@ export class StormSunderGlobalInstance {
     public btnSet: Node = null!;
 }
 
-export enum TYPE_ITEM {
-    UP_ATTACK,
-    UP_SPEED,
-    UP_EXP
-}
-
 
 

二進制
assets/module_storm_sunder/Textures/money.png


+ 134 - 0
assets/module_storm_sunder/Textures/money.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f@6c48a",
+      "displayName": "money",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "nearest",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f@f9941",
+      "displayName": "money",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 57,
+        "height": 54,
+        "rawWidth": 57,
+        "rawHeight": 54,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -28.5,
+            -27,
+            0,
+            28.5,
+            -27,
+            0,
+            -28.5,
+            27,
+            0,
+            28.5,
+            27,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            54,
+            57,
+            54,
+            0,
+            0,
+            57,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -28.5,
+            -27,
+            0
+          ],
+          "maxPos": [
+            28.5,
+            27,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "80fda1a8-217a-4296-b34c-8fb8c1c2e50f@f9941"
+  }
+}

File diff suppressed because it is too large
+ 1648 - 142
assets/module_storm_sunder/rooster_stormsunder.scene


+ 1 - 1
assets/start/Start.ts

@@ -68,7 +68,7 @@ export class Start extends Component {
             EPhysics2DDrawFlags.Joint |
             EPhysics2DDrawFlags.Shape;
 
-        PhysicsSystem2D.instance.debugDrawFlags = 1; // 启用调试绘制
+        PhysicsSystem2D.instance.debugDrawFlags = 0; // 启用调试绘制
 
         tgxModuleContext.setDefaultModule(ModuleDef.BASIC);
 

Some files were not shown because too many files changed in this diff