0224995 1 deň pred
rodič
commit
5f1973b085

+ 17 - 1
assets/Scene.meta

@@ -5,5 +5,21 @@
   "uuid": "e9e17630-3958-4a45-956e-1413bf95cdaf",
   "files": [],
   "subMetas": {},
-  "userData": {}
+  "userData": {
+    "bundleName": "Scene",
+    "isBundle": true,
+    "bundleFilterConfig": [
+      {
+        "range": "exclude",
+        "type": "asset",
+        "patchOption": {
+          "patchType": "glob",
+          "value": "db://assets/*.test"
+        },
+        "assets": [
+          "099ece80-6a52-4fc1-8f49-dcd0345183d0"
+        ]
+      }
+    ]
+  }
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 774 - 79
assets/Scene/StartScene.scene


+ 3 - 3
assets/Script/Game/MyApp/SelectTroopsBottom.ts

@@ -1,4 +1,4 @@
-import { _decorator, Button, Component, director, Node,  Sprite, SpriteFrame } from 'cc';
+import { _decorator, Button, Component, director, find, Node,  Sprite, SpriteFrame } from 'cc';
 import { GameInfo } from '../../GameInfo';
 const { ccclass, property } = _decorator;
 
@@ -21,8 +21,8 @@ export class SelectTroopsBottom extends Component {
         if (this._names) {
             GameInfo.Instance.setRoleImgNames(this._names);
             GameInfo.Instance.getGameOverReward().clear();
-            
-            director.loadScene("GameScene");
+            find("Canvas/LoadScene").active = true;
+            //director.loadScene("GameScene");
         }
     }
 

+ 37 - 0
assets/Script/Game/UI/LoadScene.ts

@@ -0,0 +1,37 @@
+import { _decorator, assetManager, Component, director, ProgressBar } from 'cc';
+const { ccclass, property } = _decorator;
+
+@ccclass('LoadScene')
+export class LoadScene extends Component {
+    private progressBar: ProgressBar = null;
+
+    start() {
+        this.progressBar = this.node.getComponentInChildren(ProgressBar);
+        this.loadSceneWithProgress("GameScene");
+    }
+
+    loadSceneWithProgress(sceneName: string) {
+        assetManager.loadBundle("Scene", (err, bundle) => {
+            if (err) {
+                console.log("加载失败", err);
+                return;
+            }
+            bundle.loadScene(
+                sceneName,
+                (finished: number, total: number) => {
+                    this.progressBar.progress = finished / total;
+                },
+                (err, sceneAsset) => {
+                    if (err) {
+                        console.log("加载场景失败", err);
+                        return;
+                    }
+                    this.node.active = false;
+                    director.runSceneImmediate(sceneAsset);
+                }
+            );
+        });
+    }
+}
+
+

+ 9 - 0
assets/Script/Game/UI/LoadScene.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "847ffa57-158f-4731-8919-cb92542b6eb3",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 6 - 7
assets/Script/Game/UI/LoadingUI.ts

@@ -1,5 +1,4 @@
-import { _decorator,Component,director,Label, ProgressBar } from 'cc';
-import { UIBase } from '../GameFrameWork/UIBase';
+import { _decorator, Component, Label, ProgressBar } from 'cc';
 const { ccclass, property } = _decorator;
 
 @ccclass('LoadingUI')
@@ -35,16 +34,16 @@ export class LoadingUI extends Component {
         this.progressLabel = this.getComponentInChildren(Label);
         this.whichRes = this.node.getChildByName("_which").getComponent(Label);
     }
-    public updateProgress(progress: number){
-        if(this.progressBar){
+    public updateProgress(progress: number) {
+        if (this.progressBar) {
             this.progressBar.progress = progress;
         }
-        if(this.progressLabel){
+        if (this.progressLabel) {
             this.progressLabel.string = `${Math.floor(progress * 100)}%`;
         }
     }
-    public updateWhichRes(which: number){
-        if(this.whichRes){
+    public updateWhichRes(which: number) {
+        if (this.whichRes) {
             this.whichRes.string = `${which}/3`;
         }
     }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov