最近把做的一个小游戏迁移到了3.0,inspector面板上自定义属性的序列化显示出现了问题。
自定义一个item类

自定义数组

在inspector面板里显示是这样的

自定义属性里的内容完全没显示上去,请问该怎么解决,还是我的写法有问题?
最近把做的一个小游戏迁移到了3.0,inspector面板上自定义属性的序列化显示出现了问题。
自定义一个item类

自定义数组

在inspector面板里显示是这样的

自定义属性里的内容完全没显示上去,请问该怎么解决,还是我的写法有问题?
然后就变成了这样

import { _decorator, CCInteger, SpriteFrame } from "cc";
const { ccclass, property } = _decorator;
@ccclass("Item")
export class Item {
@property({
displayName: "ID",
type: CCInteger,
serializable: true,
} as any)
public id: number = 0;
@property({
displayName: "Image",
type: SpriteFrame,
serializable: true,
} as any)
public img: SpriteFrame | null = null;
}
import { _decorator, Component, Node } from "cc";
import { Item } from "./Item";
const { ccclass, property } = _decorator;
@ccclass("ItemManager")
export class ItemManager extends Component {
@property([Item])
public items: Item[] = [];
}
非常感谢!
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。