0224995 1 сар өмнө
parent
commit
18aedc5af8
100 өөрчлөгдсөн 139 нэмэгдсэн , 72 устгасан
  1. 1 9
      assets/Scene/MainScene.scene
  2. 3 1
      assets/Script/DataItem/ItemData.ts
  3. 14 9
      assets/Script/Frames/ResourcesMgr.ts
  4. 33 5
      assets/Script/Game/GameFrameWork/MapMgr.ts
  5. 11 5
      assets/Script/Game/GameFrameWork/ObstacleMgr.ts
  6. 1 1
      assets/Script/Game/GameFrameWork/TouchMgr.ts
  7. 10 5
      assets/Script/Game/GameFrameWork/TowerMgr.ts
  8. 22 8
      assets/Script/Game/GameResMgr.ts
  9. 2 2
      assets/Script/MainScene.ts
  10. 29 15
      assets/Script/SelectLevel.ts
  11. 2 2
      assets/Script/SelectScene.ts
  12. 1 0
      assets/Script/StartScene.ts
  13. 10 10
      assets/resources/Data/GameResPath.csv
  14. 0 0
      assets/resources/Res/Theme.meta
  15. 0 0
      assets/resources/Res/Theme/Theme1.meta
  16. 0 0
      assets/resources/Res/Theme/Theme1/BG0.meta
  17. 0 0
      assets/resources/Res/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png
  18. 0 0
      assets/resources/Res/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png.meta
  19. 0 0
      assets/resources/Res/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png
  20. 0 0
      assets/resources/Res/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png.meta
  21. 0 0
      assets/resources/Res/Theme/Theme1/BG1.meta
  22. 0 0
      assets/resources/Res/Theme/Theme1/BG1/BG-hd.pvr.ccz.png
  23. 0 0
      assets/resources/Res/Theme/Theme1/BG1/BG-hd.pvr.ccz.png.meta
  24. 0 0
      assets/resources/Res/Theme/Theme1/BG1/BGPath.tmx
  25. 0 0
      assets/resources/Res/Theme/Theme1/BG1/BGPath.tmx.meta
  26. 0 0
      assets/resources/Res/Theme/Theme1/BG10.meta
  27. 0 0
      assets/resources/Res/Theme/Theme1/BG10/BG-hd.pvr.ccz.png
  28. 0 0
      assets/resources/Res/Theme/Theme1/BG10/BG-hd.pvr.ccz.png.meta
  29. 0 0
      assets/resources/Res/Theme/Theme1/BG10/BGPath.tmx
  30. 0 0
      assets/resources/Res/Theme/Theme1/BG10/BGPath.tmx.meta
  31. 0 0
      assets/resources/Res/Theme/Theme1/BG11.meta
  32. 0 0
      assets/resources/Res/Theme/Theme1/BG11/BG-hd.pvr.ccz.png
  33. 0 0
      assets/resources/Res/Theme/Theme1/BG11/BG-hd.pvr.ccz.png.meta
  34. 0 0
      assets/resources/Res/Theme/Theme1/BG11/BGPath.tmx
  35. 0 0
      assets/resources/Res/Theme/Theme1/BG11/BGPath.tmx.meta
  36. 0 0
      assets/resources/Res/Theme/Theme1/BG12.meta
  37. 0 0
      assets/resources/Res/Theme/Theme1/BG12/BG-hd.pvr.ccz.png
  38. 0 0
      assets/resources/Res/Theme/Theme1/BG12/BG-hd.pvr.ccz.png.meta
  39. 0 0
      assets/resources/Res/Theme/Theme1/BG12/BGPath.tmx
  40. 0 0
      assets/resources/Res/Theme/Theme1/BG12/BGPath.tmx.meta
  41. 0 0
      assets/resources/Res/Theme/Theme1/BG13.meta
  42. 0 0
      assets/resources/Res/Theme/Theme1/BG13/BG-hd.pvr.ccz.png
  43. 0 0
      assets/resources/Res/Theme/Theme1/BG13/BG-hd.pvr.ccz.png.meta
  44. 0 0
      assets/resources/Res/Theme/Theme1/BG13/BGPath.tmx
  45. 0 0
      assets/resources/Res/Theme/Theme1/BG13/BGPath.tmx.meta
  46. 0 0
      assets/resources/Res/Theme/Theme1/BG14.meta
  47. 0 0
      assets/resources/Res/Theme/Theme1/BG14/BG-hd.pvr.ccz.png
  48. 0 0
      assets/resources/Res/Theme/Theme1/BG14/BG-hd.pvr.ccz.png.meta
  49. 0 0
      assets/resources/Res/Theme/Theme1/BG14/BGPath.tmx
  50. 0 0
      assets/resources/Res/Theme/Theme1/BG14/BGPath.tmx.meta
  51. 0 0
      assets/resources/Res/Theme/Theme1/BG15.meta
  52. 0 0
      assets/resources/Res/Theme/Theme1/BG15/BG-hd.pvr.ccz.png
  53. 0 0
      assets/resources/Res/Theme/Theme1/BG15/BG-hd.pvr.ccz.png.meta
  54. 0 0
      assets/resources/Res/Theme/Theme1/BG15/BGPath.tmx
  55. 0 0
      assets/resources/Res/Theme/Theme1/BG15/BGPath.tmx.meta
  56. 0 0
      assets/resources/Res/Theme/Theme1/BG16.meta
  57. 0 0
      assets/resources/Res/Theme/Theme1/BG16/BG-hd.pvr.ccz.png
  58. 0 0
      assets/resources/Res/Theme/Theme1/BG16/BG-hd.pvr.ccz.png.meta
  59. 0 0
      assets/resources/Res/Theme/Theme1/BG16/BGPath.tmx
  60. 0 0
      assets/resources/Res/Theme/Theme1/BG16/BGPath.tmx.meta
  61. 0 0
      assets/resources/Res/Theme/Theme1/BG2.meta
  62. 0 0
      assets/resources/Res/Theme/Theme1/BG2/BG-hd.pvr.ccz.png
  63. 0 0
      assets/resources/Res/Theme/Theme1/BG2/BG-hd.pvr.ccz.png.meta
  64. 0 0
      assets/resources/Res/Theme/Theme1/BG2/BGPath.tmx
  65. 0 0
      assets/resources/Res/Theme/Theme1/BG2/BGPath.tmx.meta
  66. 0 0
      assets/resources/Res/Theme/Theme1/BG3.meta
  67. 0 0
      assets/resources/Res/Theme/Theme1/BG3/BG-hd.pvr.ccz.png
  68. 0 0
      assets/resources/Res/Theme/Theme1/BG3/BG-hd.pvr.ccz.png.meta
  69. 0 0
      assets/resources/Res/Theme/Theme1/BG3/BGPath.tmx
  70. 0 0
      assets/resources/Res/Theme/Theme1/BG3/BGPath.tmx.meta
  71. 0 0
      assets/resources/Res/Theme/Theme1/BG4.meta
  72. 0 0
      assets/resources/Res/Theme/Theme1/BG4/BG-hd.pvr.ccz.png
  73. 0 0
      assets/resources/Res/Theme/Theme1/BG4/BG-hd.pvr.ccz.png.meta
  74. 0 0
      assets/resources/Res/Theme/Theme1/BG4/BGPath.tmx
  75. 0 0
      assets/resources/Res/Theme/Theme1/BG4/BGPath.tmx.meta
  76. 0 0
      assets/resources/Res/Theme/Theme1/BG5.meta
  77. 0 0
      assets/resources/Res/Theme/Theme1/BG5/BG-hd.pvr.ccz.png
  78. 0 0
      assets/resources/Res/Theme/Theme1/BG5/BG-hd.pvr.ccz.png.meta
  79. 0 0
      assets/resources/Res/Theme/Theme1/BG5/BGPath.tmx
  80. 0 0
      assets/resources/Res/Theme/Theme1/BG5/BGPath.tmx.meta
  81. 0 0
      assets/resources/Res/Theme/Theme1/BG6.meta
  82. 0 0
      assets/resources/Res/Theme/Theme1/BG6/BG-hd.pvr.ccz.png
  83. 0 0
      assets/resources/Res/Theme/Theme1/BG6/BG-hd.pvr.ccz.png.meta
  84. 0 0
      assets/resources/Res/Theme/Theme1/BG6/BGPath.tmx
  85. 0 0
      assets/resources/Res/Theme/Theme1/BG6/BGPath.tmx.meta
  86. 0 0
      assets/resources/Res/Theme/Theme1/BG7.meta
  87. 0 0
      assets/resources/Res/Theme/Theme1/BG7/BG-hd.pvr.ccz.png
  88. 0 0
      assets/resources/Res/Theme/Theme1/BG7/BG-hd.pvr.ccz.png.meta
  89. 0 0
      assets/resources/Res/Theme/Theme1/BG7/BGPath.tmx
  90. 0 0
      assets/resources/Res/Theme/Theme1/BG7/BGPath.tmx.meta
  91. 0 0
      assets/resources/Res/Theme/Theme1/BG8.meta
  92. 0 0
      assets/resources/Res/Theme/Theme1/BG8/BG-hd.pvr.ccz.png
  93. 0 0
      assets/resources/Res/Theme/Theme1/BG8/BG-hd.pvr.ccz.png.meta
  94. 0 0
      assets/resources/Res/Theme/Theme1/BG8/BGPath.tmx
  95. 0 0
      assets/resources/Res/Theme/Theme1/BG8/BGPath.tmx.meta
  96. 0 0
      assets/resources/Res/Theme/Theme1/BG9.meta
  97. 0 0
      assets/resources/Res/Theme/Theme1/BG9/BG-hd.pvr.ccz.png
  98. 0 0
      assets/resources/Res/Theme/Theme1/BG9/BG-hd.pvr.ccz.png.meta
  99. 0 0
      assets/resources/Res/Theme/Theme1/BG9/BGPath.tmx
  100. 0 0
      assets/resources/Res/Theme/Theme1/BG9/BGPath.tmx.meta

+ 1 - 9
assets/Scene/MainScene.scene

@@ -2988,10 +2988,6 @@
     },
     "_enabled": true,
     "__prefab": null,
-    "pre": {
-      "__uuid__": "a96db15c-95b1-4bd5-a35e-0c0ca100a03e",
-      "__expectedType__": "cc.Prefab"
-    },
     "_id": "f6gVdsoS9NeImn3q4Fpgfq"
   },
   {
@@ -3220,10 +3216,6 @@
     },
     "_enabled": true,
     "__prefab": null,
-    "frame": {
-      "__uuid__": "46bb8576-a1bf-4668-8c63-9d8a7ddc7294@bdce5",
-      "__expectedType__": "cc.SpriteFrame"
-    },
     "_id": "69y8YIO/ZMIJEcXV3AMd3+"
   },
   {
@@ -4326,7 +4318,7 @@
     "node": {
       "__id__": 2
     },
-    "_enabled": true,
+    "_enabled": false,
     "__prefab": null,
     "countDown": {
       "__uuid__": "059f4316-e815-4e7f-af18-fc104ce3f1f5",

+ 3 - 1
assets/Script/DataItem/ItemData.ts

@@ -7,4 +7,6 @@ export interface GameResData extends DataBase{
     replace: string[],
     atlas: boolean
 }
-
+export interface TowerData extends DataBase{
+    chassis: string[],
+}

+ 14 - 9
assets/Script/Frames/ResourcesMgr.ts

@@ -25,11 +25,13 @@ class ResourcesMgr{
         })
        //遍历所有资源 分门别类存储到对应的容器中
        for(const asset of assets){
-          this.addRes(asset,asset.name);
+          this.addRes(asset, asset.name);
+          //console.log(assets)
        }
+       
     }
 
-    async load(path: string, name?: string, atlas: boolean = true){
+    async load(path: string, name?: string, atlas: boolean = false){
         const asset: Asset = await new Promise((value, reject)=>{
             resources.load(path, (err: Error, asset: Asset)=>{
                 if(err){
@@ -43,22 +45,25 @@ class ResourcesMgr{
         this.addRes(asset, name, atlas)
     }
 
-    addRes(asset: Asset, name: string,  atlas: boolean = true){
+    addRes(asset: Asset, name: string,  contactName: boolean = false){
         if(asset instanceof SpriteFrame){
             this._spriteFrames.set(String(name), asset);
         }
-        if(asset instanceof Prefab){
+        else if(asset instanceof Prefab){
             this._prefabs.set(String(name), asset);
             //console.log(this._prefabs)
         }
-        if(asset instanceof TiledMapAsset){
+        else if(asset instanceof TiledMapAsset){
             this._tmxAsset.set((name), asset)
+            //console.log(this._tmxAsset)
         }
-        if(asset instanceof SpriteAtlas){
-            if(atlas){
-                for(const frame of asset.getSpriteFrames()){
-                    this._spriteFrames.set(name + frame.name, frame);
+        else if(asset instanceof SpriteAtlas){
+            for(const frame of asset.getSpriteFrames()){
+                let n: string = frame.name;
+                if(contactName){
+                    n = name + n;    
                 }
+                this._spriteFrames.set(n, frame);
             }
         }
     }

+ 33 - 5
assets/Script/Game/GameFrameWork/MapMgr.ts

@@ -1,6 +1,8 @@
-import { _decorator, Size, TiledMap, TiledObjectGroup, Vec2, Vec3 } from 'cc';
+import { _decorator, Size, Sprite, TiledMap, TiledObjectGroup, Vec2, Vec3 } from 'cc';
 import { ModulerBase } from './ModulerBase';
 import { ObstacleMgr } from './ObstacleMgr';
+import { gameResMgr } from '../GameResMgr';
+import { TowerMgr } from './TowerMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('MapMgr')
@@ -8,16 +10,31 @@ export class MapMgr extends ModulerBase {
     private _tiledMap:TiledMap = null;
     private _tiledSize: Size = null;
     private _pathPoints: Vec3[] = [];
+    private _style: number = 1;
+    private _mapBg: Sprite = null;
+    private _pathBg: Sprite = null;
     tiledObjectGroup: TiledObjectGroup = null;
+
     protected onLoad(): void {
         this._tiledMap = this.getComponent(TiledMap);
-        this._tiledSize = this._tiledMap.getTileSize();
+        const bg = this.node.parent.getChildByName("Bg");
+        this._mapBg = bg.getComponent(Sprite);
+        this._pathBg = bg.getChildByName("PathBg").getComponent(Sprite);
         // this.tiledObjectGroup = this.getComponentInChildren(TiledObjectGroup);
         // this.tiledObjectGroup.getObjects();
 
     }
     start() {
-        
+        //给TiledMap设置瓦片地图资源
+        const tmx = gameResMgr.getTmx();
+        this._tiledMap.tmxAsset = tmx;
+        this._style = Number(this._tiledMap.getProperty("style"));
+        this._tiledSize = this._tiledMap.getTileSize();
+
+        //设置关卡背景图 和 路径背景图
+        this._mapBg.spriteFrame = gameResMgr.getMapBg(this._style);
+        this._pathBg.spriteFrame = gameResMgr.getPathBg();
+
         this._parseMap();
     }
     test(){
@@ -42,11 +59,22 @@ export class MapMgr extends ModulerBase {
                 //空地
             }
             else if(obj.name.includes("Ob")){
-                //障碍物
-                this.getModuler(ObstacleMgr).creatorObs(this.getCenterByObj(obj),0)
+                //障碍物 位置,哪个障碍物
+                //获取O字母前面的数字
+                const index: string = obj.name.slice(0, obj.name.indexOf("O"));
+                this.getModuler(ObstacleMgr).creatorObs(
+                    this.getCenterByObj(obj),
+                    this._style,
+                    Number(index));
+                //记录一下 占了哪个范围 后续障碍被拆除 就是可以种炮台的格子
             }
             else if(obj.name.includes("T")){
                 //赠送的炮台
+                const id: string = obj.name.slice(0, obj.name.indexOf("T"));
+                //通过id创建炮台位置
+                const pos = this.getCenterByObj(obj);
+                //通过id创建炮台
+                this.getModuler(TowerMgr).creatTower(pos, Number(id));
             }
         }
     }

+ 11 - 5
assets/Script/Game/GameFrameWork/ObstacleMgr.ts

@@ -1,11 +1,12 @@
-import { _decorator, Component, Node, Sprite, SpriteFrame, Vec3 } from 'cc';
+import { _decorator, Component, log, Node, Sprite, SpriteFrame, Vec3 } from 'cc';
 import { ModulerBase } from './ModulerBase';
+import { gameResMgr } from '../GameResMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('ObstacleMgr')
 export class ObstacleMgr extends ModulerBase {
-    @property(SpriteFrame)
-    frame: SpriteFrame = null;
+    // @property(SpriteFrame)
+    // frame: SpriteFrame = null;
     start() {
 
     }
@@ -13,9 +14,14 @@ export class ObstacleMgr extends ModulerBase {
     update(deltaTime: number) {
         
     }
-    creatorObs(pos: Vec3,index: number){
+    creatorObs(pos: Vec3, style: number, index: number){
+        const frame = gameResMgr.getObsFrame(style, index);
+        //拼接精灵帧的名字
+        // 1 => 00 01  12 => 000 12
+        let i: string = "000" + index;
+        i ="cloud" + i.slice(i.length - 2);
         const node = new Node();
-        node.addComponent(Sprite).spriteFrame = this.frame;
+        node.addComponent(Sprite).spriteFrame = frame;
         node.setPosition(pos);
         node.parent = this.node;
     }

+ 1 - 1
assets/Script/Game/GameFrameWork/TouchMgr.ts

@@ -13,7 +13,7 @@ export class TouchMgr extends ModulerBase {
             const touchPos: Vec2 = e.getUILocation();
             const pos: Vec3 = this.getModuler(MapMgr).getCenterByPos(touchPos);
             if(this.getModuler(CardMgr).touchCard(touchPos)){
-                this.getModuler(TowerMgr).creatTower(this._towerPos);
+                this.getModuler(TowerMgr).creatTower(this._towerPos,1);
                 return;
             }
             if(!this.getModuler(CardMgr).show(pos)){

+ 10 - 5
assets/Script/Game/GameFrameWork/TowerMgr.ts

@@ -1,21 +1,26 @@
-import { _decorator, instantiate, Prefab, Vec3 } from 'cc';
+import { _decorator, instantiate, log, Prefab, Sprite, Vec3 } from 'cc';
 import { ModulerBase } from './ModulerBase';
 import { GameMgr } from './GameMgr';
 import { MapMgr } from './MapMgr';
 import { resMgr } from '../../Frames/ResourcesMgr';
+import { TowerData } from '../../DataItem/ItemData';
+import { dataMgr } from '../../Frames/DataManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('TowerMgr')
 export class TowerMgr extends ModulerBase {
-    @property(Prefab)
-    pre: Prefab = null;
+    // @property(Prefab)
+    // pre: Prefab = null;
     start() {
         //GameMgr.Instance.getModuler(MapMgr).test();
         //this.getModuler(MapMgr).test();
     }
-    creatTower(pos: Vec3){
-        const node = instantiate(this.pre);
+    creatTower(pos: Vec3, id: number){
+        const data: TowerData = dataMgr.getData(id, "TowerDt");
+        const frame = resMgr.getSpriteFrame(data.chassis[0]);
+        const node = instantiate(resMgr.getPrefab("Tower"));
         //const node = instantiate(resMgr.getPrefab("Tower"));
+        node.getComponent(Sprite).spriteFrame = frame;
         node.setPosition(pos);
         node.parent = this.node;
     }

+ 22 - 8
assets/Script/Game/GameResMgr.ts

@@ -15,7 +15,7 @@
 //         pathImg:"Theme/Theme1/BGlv/BG-hd.pvr.ccz/spriteFrame",
 //         tmx:"Theme/Theme1/BG1lv/BGPath"
 
-import { Asset, SpriteFrame, TiledMapAsset } from "cc";
+import { Asset, log, SpriteFrame, TiledMapAsset } from "cc";
 import { GameResData } from "../DataItem/ItemData";
 import { dataMgr } from "../Frames/DataManager";
 import { GameInfo } from "../GameInfo";
@@ -79,26 +79,40 @@ class GameResMgr{
             await resMgr.load(path, name, data.atlas);
         }
     }
-
+    //获取当前关卡的背景图片
     getMapBg(style: number): SpriteFrame{
-        const name: string = `${GameInfo.Instance.CurLv}-${style}`;
+        const name: string = `${GameInfo.Instance.CurTheme}-${style}`;
         return resMgr.getSpriteFrame(name);
     }
-
+    //获取当前关卡的路径图片
     getPathBg(): SpriteFrame{
-        const name: string = `${GameInfo.Instance.CurLv}-${GameInfo.Instance.CurLv}-pathBg`;
+        const name: string = `${GameInfo.Instance.CurTheme}-${GameInfo.Instance.CurLv}-pathBg`;
         return resMgr.getSpriteFrame(name);
     }
-
+    //获取当前关卡的瓦片地图
     getTmx(): TiledMapAsset{
-        const name: string = `${GameInfo.Instance.CurLv}-${GameInfo.Instance.CurLv}-tmx`;
+        const name: string = `${GameInfo.Instance.CurTheme}-${GameInfo.Instance.CurLv}-tmx`;
         return resMgr.getTmxAsset(name);
     }
-
+    //获取当前主题下的某个怪物图片
     getMonsterFrame(name: string): SpriteFrame{
         name = `${GameInfo.Instance.CurLv}-name`;
         return resMgr.getSpriteFrame(name);
     }
+    //获取当前主题的style格式下的某个障碍物的图片
+    getObsFrame(style: number, index: number | string){
+        //拼接精灵帧的名字
+        // 1 => 00 01  12 => 000 12
+        let i: string;
+        if(typeof(index) === "number"){
+            i = "000" + index;
+            i = GameInfo.Instance.CurTheme + "-" + style + "-cloud" + i.slice(i.length - 2);
+        }
+        else{
+            i = GameInfo.Instance.CurTheme + "-" + style + "-cloud" + index;
+        }
+        return resMgr.getSpriteFrame(i);
+    }
 
 }
 

+ 2 - 2
assets/Script/MainScene.ts

@@ -20,11 +20,11 @@ export class MainScene extends Component {
         this.countDownTS = countDown.getComponent("CountDown");
 
         this.bg = this.node.getChildByPath("GameRoot/Bg");
-        const path: string = "Theme/Theme1/BG0/BG1-hd.pvr.ccz"
+        const path: string = "Res/Theme/Theme1/BG0/BG1-hd.pvr.ccz"
         resources.load(path, SpriteFrame, (error: Error, frame: SpriteFrame)=>{
             if(error){
                 console.error("No found!")
-                console.log(frame)
+                //console.log(frame)
             } else{
                 this.bg.getComponent(Sprite).spriteFrame = frame;
             }

+ 29 - 15
assets/Script/SelectLevel.ts

@@ -1,5 +1,7 @@
 import { _decorator, Button, Component, Node, director, PageView, resources, SpriteAtlas, error, Asset, Sprite, UITransform, SpriteFrame } from 'cc';
 import { GameInfo } from './GameInfo';
+import { resMgr } from './Frames/ResourcesMgr';
+import { gameResMgr } from './Game/GameResMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('SelectLevel')
@@ -56,9 +58,9 @@ export class SelectLevel extends Component {
         })
     }
 
-    onBtnStart(){
+    async onBtnStart(){
         GameInfo.Instance.CurLv = this.pageViewLv.getComponent(PageView).curPageIdx + 1;
-        
+        await gameResMgr.loadGameRes()
         director.loadScene("MainScene");
     }
     onBtnBack(){
@@ -75,19 +77,31 @@ export class SelectLevel extends Component {
     //资源导入
     private _loadLvRes(){
         const theme = GameInfo.Instance.CurTheme;
-        resources.load("Res/ThemeMap/Theme0" + theme ,SpriteAtlas,(error:Error | null,asset:SpriteAtlas)=>{
-            if(error){
-                console.error("No found Theme0" + theme);
-            } else {
-                for (const frame of asset.getSpriteFrames()) {
-                    if(frame.name.includes("_map")){
-                        this.pageViewLv.getComponent(PageView).addPage(this._setNode(frame));
-                    }
-                }
-                this._themeBgLeft.getComponent(Sprite).spriteFrame = asset.getSpriteFrame("Theme"+ theme + "_bgLeft");
-                this._themeBgRight.getComponent(Sprite).spriteFrame = asset.getSpriteFrame("Theme" + theme + "_bgRight");
-            }
-        })
+
+        for(let i = 1; i <= 12; i++){
+            let name: string = "000" + i;
+            name = name.slice(name.length - 2);
+            name = `Theme${theme}_map${name}`;
+            const frame = resMgr.getSpriteFrame(name);
+            this.pageViewLv.getComponent(PageView).addPage(this._setNode(frame));
+        }
+
+        this._themeBgLeft.getComponent(Sprite).spriteFrame = resMgr.getSpriteFrame("Theme"+ theme + "_bgLeft");
+        this._themeBgRight.getComponent(Sprite).spriteFrame = resMgr.getSpriteFrame("Theme" + theme + "_bgRight");
+
+        // resources.load("Res/ThemeMap/Theme0" + theme ,SpriteAtlas,(error:Error | null,asset:SpriteAtlas)=>{
+        //     if(error){
+        //         console.error("No found Theme0" + theme);
+        //     } else {
+        //         for (const frame of asset.getSpriteFrames()) {
+        //             if(frame.name.includes("_map")){
+        //                 this.pageViewLv.getComponent(PageView).addPage(this._setNode(frame));
+        //             }
+        //         }
+        //         this._themeBgLeft.getComponent(Sprite).spriteFrame = asset.getSpriteFrame("Theme"+ theme + "_bgLeft");
+        //         this._themeBgRight.getComponent(Sprite).spriteFrame = asset.getSpriteFrame("Theme" + theme + "_bgRight");
+        //     }
+        // })
     }
     //设置PageView的页面
     private _setNode(frame: SpriteFrame): Node{

+ 2 - 2
assets/Script/SelectScene.ts

@@ -28,8 +28,8 @@ export class SelectScene extends Component {
     btnLeft: Node = null;
 
     start() {
-        console.log("resMgr:" + resMgr)
-        console.log("dataMgr:" + dataMgr.getAllDataByName("GameResPath"));
+        // console.log("resMgr:" + resMgr)
+        // console.log("dataMgr:" + dataMgr.getAllDataByName("GameResPath"));
          //总页数
          this.totalPages = this.pageView.getComponent(PageView).getPages().length;
          //当前索引值

+ 1 - 0
assets/Script/StartScene.ts

@@ -33,6 +33,7 @@ export class NewComponent extends Component {
     async start() {
         await dataMgr.loadDataDir("Data");
         await resMgr.loadAllRes("Res");
+        await resMgr.loadAllRes("Theme");
 
         this._logo();
 

+ 10 - 10
assets/resources/Data/GameResPath.csv

@@ -1,10 +1,10 @@
-Êý¾ÝµÄÊôÐÔ,id,resName,path,replace,atlas
-Êý¾ÝÀàÐÍ,number,string,string,string[],boolean
-ÍßƬµØͼ,1,theme-lv-tmx,Theme/Themetheme/BGlv/BGPath,theme;lv,0
-µØͼ»­Ãæ,2,theme-lv-pathBg,Theme/Themetheme/BGlv/BG-hd.pvr.ccz/spriteFrame,theme;lv,0
-±³¾°1,3,theme-1,Theme/Themetheme/BG0/BG1-hd.pvr.ccz/spriteFrame,theme,0
-±³¾°2,4,theme-2,Theme/Themetheme/BG0/BG2-hd.pvr.ccz/spriteFrame,theme,0
-¹ÖÎïͼ¼¯1,5,theme-,Theme/Themetheme/Items/Monsters01-hd,theme,1
-¹ÖÎïͼ¼¯2,6,theme-,Theme/Themetheme/Items/Monsters02-hd,theme,1
-ÕÏ°­Îïͼ¼¯1,7,theme-1-,Theme/Themetheme/Items/Object01-hd,theme,1
-ÕÏ°­Îïͼ¼¯2,8,theme-2-,Theme/Themetheme/Items/Object02-hd,theme,1
+���ݵ�����,id,resName,path,replace,atlas
+��������,number,string,string,string[],boolean
+��Ƭ��ͼ,1,theme-lv-tmx,Res/Theme/Themetheme/BGlv/BGPath,theme;lv,0
+��ͼ����,2,theme-lv-pathBg,Res/Theme/Themetheme/BGlv/BG-hd.pvr.ccz/spriteFrame,theme;lv,0
+����1,3,theme-1,Res/Theme/Themetheme/BG0/BG1-hd.pvr.ccz/spriteFrame,theme,0
+����2,4,theme-2,Res/Theme/Themetheme/BG0/BG2-hd.pvr.ccz/spriteFrame,theme,0
+����ͼ��1,5,theme-,Res/Theme/Themetheme/Items/Monsters01-hd,theme,1
+����ͼ��2,6,theme-,Res/Theme/Themetheme/Items/Monsters02-hd,theme,1
+�ϰ���ͼ��1,7,theme-1-,Res/Theme/Themetheme/Items/Object01-hd,theme,1
+�ϰ���ͼ��2,8,theme-2-,Res/Theme/Themetheme/Items/Object02-hd,theme,1

+ 0 - 0
assets/resources/Theme.meta → assets/resources/Res/Theme.meta


+ 0 - 0
assets/resources/Theme/Theme1.meta → assets/resources/Res/Theme/Theme1.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG0.meta → assets/resources/Res/Theme/Theme1/BG0.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG0/BG1-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG0/BG2-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG1.meta → assets/resources/Res/Theme/Theme1/BG1.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG1/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG1/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG1/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG1/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG1/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG1/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG1/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG1/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG10.meta → assets/resources/Res/Theme/Theme1/BG10.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG10/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG10/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG10/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG10/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG10/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG10/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG10/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG10/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG11.meta → assets/resources/Res/Theme/Theme1/BG11.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG11/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG11/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG11/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG11/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG11/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG11/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG11/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG11/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG12.meta → assets/resources/Res/Theme/Theme1/BG12.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG12/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG12/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG12/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG12/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG12/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG12/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG12/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG12/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG13.meta → assets/resources/Res/Theme/Theme1/BG13.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG13/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG13/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG13/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG13/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG13/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG13/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG13/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG13/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG14.meta → assets/resources/Res/Theme/Theme1/BG14.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG14/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG14/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG14/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG14/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG14/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG14/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG14/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG14/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG15.meta → assets/resources/Res/Theme/Theme1/BG15.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG15/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG15/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG15/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG15/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG15/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG15/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG15/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG15/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG16.meta → assets/resources/Res/Theme/Theme1/BG16.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG16/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG16/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG16/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG16/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG16/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG16/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG16/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG16/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG2.meta → assets/resources/Res/Theme/Theme1/BG2.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG2/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG2/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG2/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG2/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG2/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG2/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG2/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG2/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG3.meta → assets/resources/Res/Theme/Theme1/BG3.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG3/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG3/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG3/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG3/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG3/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG3/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG3/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG3/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG4.meta → assets/resources/Res/Theme/Theme1/BG4.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG4/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG4/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG4/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG4/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG4/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG4/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG4/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG4/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG5.meta → assets/resources/Res/Theme/Theme1/BG5.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG5/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG5/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG5/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG5/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG5/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG5/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG5/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG5/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG6.meta → assets/resources/Res/Theme/Theme1/BG6.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG6/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG6/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG6/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG6/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG6/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG6/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG6/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG6/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG7.meta → assets/resources/Res/Theme/Theme1/BG7.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG7/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG7/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG7/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG7/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG7/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG7/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG7/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG7/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG8.meta → assets/resources/Res/Theme/Theme1/BG8.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG8/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG8/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG8/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG8/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG8/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG8/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG8/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG8/BGPath.tmx.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG9.meta → assets/resources/Res/Theme/Theme1/BG9.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG9/BG-hd.pvr.ccz.png → assets/resources/Res/Theme/Theme1/BG9/BG-hd.pvr.ccz.png


+ 0 - 0
assets/resources/Theme/Theme1/BG9/BG-hd.pvr.ccz.png.meta → assets/resources/Res/Theme/Theme1/BG9/BG-hd.pvr.ccz.png.meta


+ 0 - 0
assets/resources/Theme/Theme1/BG9/BGPath.tmx → assets/resources/Res/Theme/Theme1/BG9/BGPath.tmx


+ 0 - 0
assets/resources/Theme/Theme1/BG9/BGPath.tmx.meta → assets/resources/Res/Theme/Theme1/BG9/BGPath.tmx.meta


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