Browse Source

a_little_problem

0224995 1 week ago
parent
commit
9b8044ed48

+ 52 - 52
assets/Scene/GameScene.scene

@@ -92,8 +92,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 640,
-      "y": 360.0849256900213,
+      "x": 639.9999999999999,
+      "y": 360.00000000000006,
       "z": 0
     },
     "_lrot": {
@@ -178,7 +178,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 360.08492569002124,
+    "_orthoHeight": 360,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -355,8 +355,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 552.4038513800424
+      "width": 1279.9999999999998,
+      "height": 552.2339999999999
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -457,8 +457,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -640,
-      "y": -360.08492569002124,
+      "x": -639.9999999999999,
+      "y": -360,
       "z": 0
     },
     "_lrot": {
@@ -496,8 +496,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -596,8 +596,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -565,
-      "y": 87.58492569002124,
+      "x": -564.9999999999999,
+      "y": 87.5,
       "z": 0
     },
     "_lrot": {
@@ -1416,8 +1416,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 565,
-      "y": 87.58492569002124,
+      "x": 564.9999999999999,
+      "y": 87.5,
       "z": 0
     },
     "_lrot": {
@@ -2205,7 +2205,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -270.08492569002124,
+      "y": -270,
       "z": 0
     },
     "_lrot": {
@@ -2259,7 +2259,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -557.33203125,
+      "x": -557.3320312499999,
       "y": 42.8,
       "z": 0
     },
@@ -2602,7 +2602,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -365,
+      "x": -364.9999999999999,
       "y": 0,
       "z": 0
     },
@@ -3380,7 +3380,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 125,
+      "x": 124.99999999999989,
       "y": 0,
       "z": 0
     },
@@ -9578,7 +9578,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 558,
+      "x": 557.9999999999999,
       "y": 0,
       "z": 0
     },
@@ -10459,7 +10459,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 125,
+      "x": 124.99999999999989,
       "y": 0,
       "z": 0
     },
@@ -10562,7 +10562,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
+      "width": 1279.9999999999998,
       "height": 180
     },
     "_anchorPoint": {
@@ -10695,8 +10695,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -640,
-      "y": -360.08492569002124,
+      "x": -639.9999999999999,
+      "y": -360,
       "z": 0
     },
     "_lrot": {
@@ -11572,8 +11572,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -11624,8 +11624,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -11687,8 +11687,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -640,
-      "y": -360.08492569002124,
+      "x": -639.9999999999999,
+      "y": -360,
       "z": 0
     },
     "_lrot": {
@@ -11726,8 +11726,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -11808,8 +11808,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -640,
-      "y": -360.08492569002124,
+      "x": -639.9999999999999,
+      "y": -360,
       "z": 0
     },
     "_lrot": {
@@ -12685,8 +12685,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -12737,8 +12737,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -17667,8 +17667,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -584.8,
-      "y": 228.68492569002123,
+      "x": -584.7999999999998,
+      "y": 228.6,
       "z": 0
     },
     "_lrot": {
@@ -18830,8 +18830,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18894,8 +18894,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -19064,8 +19064,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -19164,8 +19164,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -19264,8 +19264,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -19316,8 +19316,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -19370,8 +19370,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1279.9999999999998,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 15 - 15
assets/Scene/StartScene.scene

@@ -98,8 +98,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 640,
-      "y": 360.0849256900213,
+      "x": 640.0000000000001,
+      "y": 360.00000000000006,
       "z": 0
     },
     "_lrot": {
@@ -184,7 +184,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 360.08492569002124,
+    "_orthoHeight": 360,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -256,8 +256,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": -0.08492569002123673,
+      "x": -1.1368683772161603e-13,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -12707,8 +12707,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1280.0000000000002,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -12807,8 +12807,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1280.0000000000002,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -12907,8 +12907,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1280.0000000000002,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -12959,8 +12959,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1280.0000000000002,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -13960,8 +13960,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720.1698513800425
+      "width": 1280.0000000000002,
+      "height": 720
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 34 - 32
assets/Script/Frames/DataManager.ts

@@ -1,40 +1,40 @@
-import { JsonAsset, resources, TextAsset } from "cc";
+import { AssetManager, JsonAsset, resources, TextAsset } from "cc";
 
-export interface DataBase{
+export interface DataBase {
     id: number;
 }
 
 //一个文件 对应一个数据操作者
-class DataCtrl{
+class DataCtrl {
     private _datas: Map<number, DataBase> = new Map();
-    constructor(asset: JsonAsset | TextAsset){
-        if(asset instanceof JsonAsset){
+    constructor(asset: JsonAsset | TextAsset) {
+        if (asset instanceof JsonAsset) {
             const datas: DataBase[] = <DataBase[]>asset.json;
-            for(const data of datas){
+            for (const data of datas) {
                 this._datas.set(Number(data.id), data);
             }
             return;
         }
         //表格数据
-        if(asset instanceof TextAsset){
+        if (asset instanceof TextAsset) {
             this._parseCSV(asset.text);
         }
     }
-    private _parseCSV(text: string){
+    private _parseCSV(text: string) {
         const lines: string[] = text.split("\r\n");
         //表格中 单元格以逗号,分开
         const keys: string[] = lines[0].split(",");
         const types: string[] = lines[1].split(",");
         //有用的数据
-        for(let i = 2; i < lines.length - 1; i++){
+        for (let i = 2; i < lines.length - 1; i++) {
             const cols: string[] = lines[i].split(",");
             //每一行就是一个数据 创建一个空对象 存储数据
             let obj = {};
-            for(let j = 1; j <cols.length; j++){
+            for (let j = 1; j < cols.length; j++) {
                 //获取当前字符串值 根据类型定数据
                 let val = cols[j];
                 let v;
-                switch(types[j]){
+                switch (types[j]) {
                     case "boolean":
                         v = Boolean(Number(val));
                         break;
@@ -49,8 +49,8 @@ class DataCtrl{
                         break;
                     case "number[]":
                         v = val.split(";");
-                        let arr:number[] = [];
-                        for(const info of v){
+                        let arr: number[] = [];
+                        for (const info of v) {
                             arr.push(Number(info));
                         }
                         v = arr;
@@ -66,53 +66,55 @@ class DataCtrl{
     }
 
     //通过id获取某个数据
-    getData<T extends DataBase>(id: number):T{
+    getData<T extends DataBase>(id: number): T {
         return <T>this._datas.get(id);
     }
 
     //获取当前文件解析的所有数据
-    getAllData<T extends DataBase>(): T[]{
+    getAllData<T extends DataBase>(): T[] {
         return <T[]>Array.from(this._datas.values());
     }
 }
 
 //管理所有数据操作者
-class DataManager{
+class DataManager {
     private _dataCtrls: Map<string, DataCtrl> = new Map();
     static instance: DataManager = null;
 
-    async loadDataDir(dir: string){
-        const assets: TextAsset[] | JsonAsset[] = await new Promise((values, reject)=>{
-            resources.loadDir(dir,(err: Error, assets: TextAsset[] | JsonAsset[])=>{
-                if(err){
-                    reject(err);
-                }
-                else{
-                    values(assets);
-                }
-            })
+    async loadDataDir(dir: string, onProgress: (
+        (finish: number, total: number, item: AssetManager.RequestItem) => void) = null) {
+        const assets: TextAsset[] | JsonAsset[] = await new Promise((values, reject) => {
+            resources.loadDir(dir,
+                onProgress, (err: Error, assets: TextAsset[] | JsonAsset[]) => {
+                    if (err) {
+                        reject(err);
+                    }
+                    else {
+                        values(assets);
+                    }
+                })
         })
 
-        for(const asset of assets){
+        for (const asset of assets) {
             this._dataCtrls.set(asset.name, new DataCtrl(asset));
         }
     }
 
-    getData<T extends DataBase>(id: number, ctrlName?: string):T{
+    getData<T extends DataBase>(id: number, ctrlName?: string): T {
         //通过文件名 获取 数据操作者
-        if(ctrlName){
+        if (ctrlName) {
             return this._dataCtrls.get(ctrlName).getData<T>(id);
         }
         //遍历所有的数据操作者 看看谁有id 为 id 的数据
-        for(const ctrl of Array.from(this._dataCtrls.values())){
+        for (const ctrl of Array.from(this._dataCtrls.values())) {
             const data = ctrl.getData<T>(id);
-            if(data){return data;}
+            if (data) { return data; }
         }
         //都没有
         return null;
     }
 
-    getAllDataByName<T extends DataBase>(name: string):T[]{
+    getAllDataByName<T extends DataBase>(name: string): T[] {
         //获取文件名为 name 的数据操作者的所有数据
         return this._dataCtrls.get(name).getAllData<T>();
     }

+ 6 - 8
assets/Script/Frames/LocalDt.ts

@@ -11,31 +11,29 @@ class LocalStorage {
     }
     //保存玩家名字
     savePlayerName(name: string) {
-        localStorage.setItem(`PlayerName`, JSON.stringify(name));
+        localStorage.setItem("PlayerName", JSON.stringify(name));
     }
     //获取玩家名字
     getPlayerName(): string {
-        const jsonStr = localStorage.getItem(`PlayerName`)
+        const jsonStr = localStorage.getItem("PlayerName")
         return JSON.parse(jsonStr);
     }
     //金币
     saveGold(num: number) {
-        localStorage.setItem(`Gold`, JSON.stringify(num));
+        localStorage.setItem("Gold", JSON.stringify(num));
     }
     getGold(): number {
-        const jsonStr = localStorage.getItem(`Gold`)
+        const jsonStr = localStorage.getItem("Gold")
         return JSON.parse(jsonStr);
     }
     //钻石
     saveDiamond(num: number) {
-        localStorage.setItem(`Diamond`, JSON.stringify(num));
+        localStorage.setItem("Diamond", JSON.stringify(num));
     }
     getDiamond(): number {
-        const jsonStr = localStorage.getItem(`Diamond`)
+        const jsonStr = localStorage.getItem("Diamond")
         return JSON.parse(jsonStr);
     }
-
-
 }
 export const localDt: LocalStorage = LocalStorage.instance = new LocalStorage();
 

+ 17 - 14
assets/Script/Game/MyApp.ts

@@ -14,32 +14,35 @@ export class MyApp extends Component {
     protected onLoad(): void {
         this.loadingUI = this.node.getChildByName("LoadingUI");
     }
-    protected async start(){
-        if(MyApp.hasOpenedStartUI) return;
+    protected async start() {
+        if (MyApp.hasOpenedStartUI) return;
         const loadingUI = this.loadingUI?.getComponent(LoadingUI)
-        if(!this.loadingUI.active){
+        if (!this.loadingUI.active) {
             this.loadingUI.active = true;
         }
-        await dataMgr.loadDataDir("Data");
-        await resMgr.loadAllRes("Res", (finish, total)=>{
-                loadingUI?.updateProgress(finish / total);
-                loadingUI?.updateWhichRes(1);
+        await dataMgr.loadDataDir("Data", (finish, total) => {
+            loadingUI?.updateProgress(finish / total);
+            loadingUI?.updateWhichRes(1);
         });
-        await resMgr.loadAllRes("UI", (finish, total)=>{
-                loadingUI?.updateProgress(finish / total);
-                loadingUI?.updateWhichRes(2);
+        await resMgr.loadAllRes("Res", (finish, total) => {
+            loadingUI?.updateProgress(finish / total);
+            loadingUI?.updateWhichRes(2);
         });
-        if(!localDt.getGold()){
+        await resMgr.loadAllRes("UI", (finish, total) => {
+            loadingUI?.updateProgress(finish / total);
+            loadingUI?.updateWhichRes(2);
+        });
+        if (!localDt.getGold()) {
             localDt.saveGold(8888);
         }
-        if(!localDt.getDiamond()){
+        if (!localDt.getDiamond()) {
             localDt.saveDiamond(200);
         }
-        if(!localDt.getLvDt()){
+        if (!localDt.getLvDt()) {
             localDt.saveLvDt(1);
         }
         this.loadingUI.active = false;
-        if(!MyApp.hasOpenedStartUI){
+        if (!MyApp.hasOpenedStartUI) {
             UIMgr.openUI("Start");
             MyApp.hasOpenedStartUI = true;
         }

+ 1 - 1
assets/Script/Game/MyApp/GameScene/BulletPool.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, instantiate, Node, NodePool, Pool, Prefab } from 'cc';
+import { _decorator, Component, instantiate, Node, NodePool, Prefab } from 'cc';
 import { resMgr } from '../../../Frames/ResourcesMgr';
 const { ccclass, property } = _decorator;
 

+ 1 - 0
assets/Script/Game/MyApp/GameScene/EnemyTower.ts

@@ -30,6 +30,7 @@ export class EnemyTower extends Role {
     private _initLifeBar() {
         this._lifeBar._curHp = this.hp;
         this._lifeBar._totalHp = this.hp;
+        this._lifeBar.progressBar.progress = 1;
     }
     update(deltaTime: number) {
         if (this._lifeBar._curHp <= 0) {

+ 2 - 2
assets/Script/Game/MyApp/GameScene/GameOver.ts

@@ -100,9 +100,9 @@ export class GameOver extends ModulerBase {
         if (GameInfo.Instance.getOverWin()) {
             //初始化场景
             this._initGameScene();
-            console.log("下一关")
         } else {
-            //director.loadScene("GameScene")
+            //初始化场景
+            this._initGameScene();
         }
     }
 

+ 5 - 6
assets/Script/Game/MyApp/GameScene/LifeBar.ts

@@ -1,25 +1,24 @@
 import { _decorator, Component, ProgressBar } from 'cc';
-import { Role, RoleState } from '../Role';
 const { ccclass, property } = _decorator;
 
 @ccclass('LifeBar')
 export class LifeBar extends Component {
     _curHp: number = null;
     _totalHp: number = null;
-    private _progressBar: ProgressBar = null;
+    progressBar: ProgressBar = null;
     protected onLoad(): void {
-        this._progressBar = this.node.getChildByName("ProgressBar").getComponent(ProgressBar);
+        this.progressBar = this.node.getChildByName("ProgressBar").getComponent(ProgressBar);
     }
     start() {
-        this._progressBar.progress = this._curHp / this._totalHp;
+        this.progressBar.progress = this._curHp / this._totalHp;
     }
     updateProgressBar(hp: number) {
         this._curHp = hp;
-        this._progressBar.progress = this._curHp / this._totalHp;
+        this.progressBar.progress = this._curHp / this._totalHp;
         if (hp <= 0) {
             // this._role.playAnimation(RoleState.Die);
             this._curHp = 0;
-            this._progressBar.progress = 0;
+            this.progressBar.progress = 0;
         }
     }
 }

+ 1 - 0
assets/Script/Game/MyApp/GameScene/MyTower.ts

@@ -27,6 +27,7 @@ export class MyTower extends Role {
     private _initLifeBar() {
         this._lifeBar._curHp = GameInfo.Instance.getMyTowerHp();
         this._lifeBar._totalHp = GameInfo.Instance.getMyTowerHp();
+        this._lifeBar.progressBar.progress = 1;
     }
 
     update(deltaTime: number) {

+ 4 - 22
assets/Script/Game/MyApp/Role.ts

@@ -1,4 +1,4 @@
-import { _decorator, Animation, AnimationClip, BoxCollider2D, Component, find, Node, PhysicsSystem2D, SpriteFrame, Vec2, Vec3 } from 'cc';
+import { _decorator, Animation, AnimationClip, Component, find, Node, PhysicsSystem2D, SpriteFrame, Vec2, Vec3 } from 'cc';
 import { RoleData } from '../../DataItem/ItemData';
 import { resMgr } from '../../Frames/ResourcesMgr';
 import { Bullet } from './GameScene/Bullet';
@@ -98,7 +98,6 @@ export class Role extends Component {
         this.node.setWorldPosition(pos);
         this.bulletLayer = find("Canvas/GameRoot/BulletLayer");
 
-        //this._setupPhysics();
     }
 
     private _setRoleData(roleData: RoleData) {
@@ -108,13 +107,6 @@ export class Role extends Component {
         this.moveSpeed = roleData.moveSpeed;
     }
 
-    // _setupPhysics() {
-    //     //确保有碰撞组件
-    //     const collider2D = this.getComponent(BoxCollider2D) || this.addComponent(BoxCollider2D);
-    //     collider2D.group = this._getCollisionGroup();
-    //     collider2D.apply();
-    // }
-
     //获取精灵帧组 
     /*
     count -> 精灵帧的数量 
@@ -158,7 +150,9 @@ export class Role extends Component {
 
     //寻敌
     private _detectEnemies() {
+        //节点不可用,不寻敌
         if (!this.node.isValid) return;
+        //游戏结束,不寻敌
         if(GameInfo.Instance.getIsGameOver()) return;
         //const startPos = new Vec2(this.node.position.x, this.node.position.y);
         const startPos = this.node.position.clone();
@@ -242,18 +236,6 @@ export class Role extends Component {
 
     //将各个动画存储起来
     private _collectAni() {
-        // const moveAni: Animation = Tools.createAnimation(this._moveFrames, 8, this.node, AnimationClip.WrapMode.Loop)
-        // this._animations.set(RoleState.Move, moveAni);
-
-        // const atkAni: Animation = Tools.createAnimation(this._atkFrames, 8, this.node, AnimationClip.WrapMode.Loop)
-        // this._animations.set(RoleState.Attack, atkAni);
-
-        // const idleAni: Animation = Tools.createAnimation(this._idleFrames, 8, this.node, AnimationClip.WrapMode.Loop)
-        // this._animations.set(RoleState.Idle, idleAni);
-
-        // const dieAni: Animation = Tools.createAnimation(this._dieFrames, 8, this.node, AnimationClip.WrapMode.Normal)
-        // this._animations.set(RoleState.Die, dieAni);
-
         this._createClip(RoleState.Move, this._moveFrames, 8);
         this._createClip(RoleState.Attack, this._atkFrames, 6);
         this._createClip(RoleState.Idle, this._idleFrames, 8);
@@ -299,7 +281,7 @@ export class Role extends Component {
 
     private _switchState(state: RoleState, clipName: string) {
         this._state = state;
-        this._animation.stop();
+        //this._animation.stop();
         this._animation.play(clipName);
 
         if (state === RoleState.Die) {

+ 1 - 1
assets/Script/Game/UI/LoadingUI.ts

@@ -45,7 +45,7 @@ export class LoadingUI extends Component {
     }
     public updateWhichRes(which: number){
         if(this.whichRes){
-            this.whichRes.string = `${which}/2`;
+            this.whichRes.string = `${which}/3`;
         }
     }
 }

+ 0 - 3
build-templates/templates-version.json

@@ -1,3 +0,0 @@
-{
-    "wechatgame": "1.0.0"
-}

+ 0 - 80
build-templates/wechatgame/game.ejs

@@ -1,80 +0,0 @@
-function __initApp () {  // init app
-globalThis.__wxRequire = require;  // FIX: require cannot work in separate engine 
-require('./web-adapter');
-const firstScreen = require('./first-screen');
-
-<%- include(cocosTemplate, {}) %>
-
-// Adapt for IOS, swap if opposite
-const info = wx.getSystemInfoSync();
-if (canvas){
-    var _w = canvas.width;
-    var _h = canvas.height;
-    if (info.screenWidth < info.screenHeight) {
-        if (canvas.width > canvas.height) {
-            _w = canvas.height;
-            _h = canvas.width;
-        }
-    } else {
-        if (canvas.width < canvas.height) {
-            _w = canvas.height;
-            _h = canvas.width;
-        }
-    }
-    canvas.width = _w;
-    canvas.height = _h;
-}
-// Adjust initial canvas size
-if (canvas && window.devicePixelRatio >= 2) {canvas.width *= info.devicePixelRatio; canvas.height *= info.devicePixelRatio;}
-
-const importMap = require("<%= importMapFile%>").default;
-System.warmup({
-    importMap,
-    importMapUrl: '<%= importMapFile%>',
-    defaultHandler: (urlNoSchema) => {
-        require('.' + urlNoSchema);
-    },
-    handlers: {
-        'plugin:': (urlNoSchema) => {
-            requirePlugin(urlNoSchema);
-        },
-        'project:': (urlNoSchema) => {
-            require(urlNoSchema);
-        },
-    },
-});
-
-firstScreen.start('<%= alpha %>', '<%= antialias %>', '<%= useWebgl2 %>').then(() => {
-    return System.import('<%= applicationJs %>');
-}).then((module) => {
-    return firstScreen.setProgress(0.2).then(() => Promise.resolve(module));
-}).then(({ Application }) => {
-    return new Application();
-}).then((application) => {
-    return firstScreen.setProgress(0.4).then(() => Promise.resolve(application));
-}).then((application) => {
-    return onApplicationCreated(application);
-}).catch((err) => {
-    console.error(err);
-});
-
-function onApplicationCreated(application) {
-    return System.import('cc').then((module) => {
-        return firstScreen.setProgress(0.6).then(() => Promise.resolve(module));
-    }).then((cc) => {
-        require('./engine-adapter');
-        return application.init(cc);
-    }).then(() => {
-        return firstScreen.end().then(() => application.start());
-    });
-}
-
-}  // init app
-
-// NOTE: on WeChat Android end, we can only get the correct screen size at the second tick of game.
-var sysInfo = wx.getSystemInfoSync();
-if (sysInfo.platform.toLocaleLowerCase() === 'android') {
-    GameGlobal.requestAnimationFrame (__initApp);
-} else {
-    __initApp();
-}

+ 0 - 10
build-templates/wechatgame/game.json

@@ -1,10 +0,0 @@
-{
-  "deviceOrientation": "portrait",
-  "openDataContext": "",
-  "networkTimeout": {
-    "request": 5000,
-    "connectSocket": 5000,
-    "uploadFile": 5000,
-    "downloadFile": 500000
-  }
-}

+ 0 - 35
build-templates/wechatgame/project.config.json

@@ -1,35 +0,0 @@
-{
-    "description": "项目配置文件。",
-    "miniprogramRoot": "./",
-    "setting": {
-        "urlCheck": true,
-        "postcss": true,
-        "minified": true,
-        "newFeature": false,
-        "enhance": true,
-        "useIsolateContext": true
-    },
-    "compileType": "game",
-    "libVersion": "game",
-    "appid": "",
-    "projectname": "",
-    "condition": {
-        "search": {
-            "current": -1,
-            "list": []
-        },
-        "conversation": {
-            "current": -1,
-            "list": []
-        },
-        "game": {
-            "currentL": -1,
-            "list": [],
-            "current": -1
-        },
-        "miniprogram": {
-            "current": -1,
-            "list": []
-        }
-    }
-}