继承了GList对象,封装了一些函数,无法SetPackageItemExtension怎么办

一直提示InvalidCastException: Specified cast is not valid.
GInventory _inventory = (GInventory)this.contentPane.GetChild("inventory").asList;
已邀请:

谷主

赞同来自:

GList不是资源,没有办法setextension,也没有办法继承。给他添加办法不需要继承,把GList标记为partial,再在外部添加函数就行了。

要回复问题请先登录注册