插件Glist问题

const itemRenderer: FairyGUI.ListItemRenderer = ( index: number, obj: FairyGUI.GObject )=>{
                if (obj instanceof ListItem) {
                    obj.data = this._array && this._array[index];
                    obj.setIndex(index);
                }
            }
            this.list.itemRenderer = itemRenderer;
这里报错还是没有修改吗
 
 
另外

let url: string = FairyGUI.UIPackage.GetItemURL(pkgName, resName);
        console.log("---------->registerClass pkgName: "+pkgName + " resName: " + resName + " url: " + url );
        FairyGUI.UIObjectFactory.SetPackageItemExtension(url, $typeof(cls) );//这里注册自定类也注册不起呢
 
QQ图片20201105163501.png QQ图片20201105163630.png
已邀请:

谷主

赞同来自:

改了lua的,可能忘了改ts的了,下次更新修正。
其实插件里不需要用虚拟列表。pc很强大,直接几百条加进去没压力。

taojianlong - 80后IT男

赞同来自:

根据插件列子写得

taojianlong - 80后IT男

赞同来自:

这是什么错,2020.3.2版本?

谷主

赞同来自:

错误很明显了,自己debug

taojianlong - 80后IT男

赞同来自:

谷主

赞同来自:

不能直接SetPackageItemExtension一个typescript的类的,类型不兼容。参考这里https://www.fairygui.com/docs/ ... %2595

要回复问题请先登录注册