baxi пре 1 месец
родитељ
комит
d6e25edad6

+ 10 - 10
assets/lobbyRes/scenes/Lobby.scene

@@ -80,7 +80,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 667,
-      "y": 374.99999999999994,
+      "y": 375,
       "z": 1000
     },
     "_lrot": {
@@ -120,7 +120,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 416.5695970695971,
+    "_orthoHeight": 375,
     "_near": 1,
     "_far": 2000,
     "_color": {
@@ -199,7 +199,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 667,
-      "y": 374.99999999999994,
+      "y": 375,
       "z": 0
     },
     "_lrot": {
@@ -524,7 +524,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -624,7 +624,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -724,7 +724,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -824,7 +824,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1090,7 +1090,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1190,7 +1190,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1242,7 +1242,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1334,
-      "height": 749.9999999999999
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 1 - 1
assets/scripts/framework/ui/UIManager.ts

@@ -38,7 +38,7 @@ export class UIManager {
 
       const views = root.getComponentsInChildren(UIView);
       for (const view of views) {
-        const viewId = view.viewId;
+        const viewId = view.getViewID();
         if (!viewId) {
           console.warn(`[UIManager] Scene UIView has no viewId: ${view.node.name}`);
           continue;

+ 7 - 0
assets/scripts/framework/ui/UIView.ts

@@ -10,6 +10,13 @@ export class UIView<TParams = unknown> extends Component {
   /** UIManager 用它识别并接管场景中预放置的 UIView。 */
   readonly viewId: UIViewID | null = null;
 
+  public getViewID(): UIViewID {
+    if (!this.viewId) {
+      return (this?.node?.name || "") as UIViewID;
+    }
+    return this.viewId;
+  }
+
   async internalCreate(): Promise<void> {
     await this.onCreate();
   }

+ 3 - 0
assets/scripts/modules/lobby/ui/LoadingView.ts

@@ -1,3 +1,4 @@
+import { UIViewID } from '@scripts/define/UIDefine';
 import { UICloseReason } from '@scripts/framework/ui/UILayer';
 import { UIView } from '@scripts/framework/ui/UIView';
 import { _decorator, Component, Node, Tween, tween } from 'cc';
@@ -5,6 +6,8 @@ const { ccclass, property } = _decorator;
 
 @ccclass('LoadingView')
 export class LoadingView extends UIView {
+    readonly viewId = UIViewID.LoadingView;
+
     @property(Node)
     circleNode: Node = null;