@@ -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 @@
"z": 0
@@ -524,7 +524,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
- "height": 749.9999999999999
+ "height": 750
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -624,7 +624,7 @@
@@ -724,7 +724,7 @@
@@ -824,7 +824,7 @@
@@ -1090,7 +1090,7 @@
@@ -1190,7 +1190,7 @@
@@ -1242,7 +1242,7 @@
@@ -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;
@@ -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();
}
@@ -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;