编辑器使用插件生成代码时,有方法获得控件里GList使用的默认项目资源吗?

memberInfo里没有看到相关的属性
已邀请:

谷主

赞同来自:

只能读取组件的xml。handler.getItemDesc

hible

赞同来自:

我将所有能打印的都打印出来都找不到,才想到来论坛问。。。。新版本有做这个优化了吗?

谷主

赞同来自:

list所在的组件的xml里当然有啊,api都给出来了

hible

赞同来自:

不是,说的是这个
test.jpg

 
memberInfo里没有找到有这个数据,然后我将所有能打印的都打印了。xml里只有资源,但没办法绑定回这个list里实际的项目资源
---@class CS.FairyEditor.PublishHandler.MemberInfo
---@field public name string
---@field public varName string
---@field public type string
---@field public index number
---@field public group number
---@field public res CS.FairyEditor.FPackageItem
CS.FairyEditor.PublishHandler.MemberInfo = {}

---@return CS.FairyEditor.PublishHandler.MemberInfo
function CS.FairyEditor.PublishHandler.MemberInfo.New()
end

return CS.FairyEditor.PublishHandler.MemberInfo

谷主

赞同来自:

不在memberinfo里,他在xml里,就是一个url字符串,打开包含列表的组件的xml看看就知道了

hible

赞同来自:


local d = handler:GetItemDesc( memberInfo.res )
_classFieldAnnotation = _classFieldAnnotation .. string.format('---@field public xml %s %s \n', memberInfo.varName, d:ToXMLString(true));
出来的都是的image和component。但是我想要的是list的东西啊,我只想要list绑定的资源组件是什么。
 
xml出来的东西只是这样的,没法知道list的是几十个component里的那一个。
<packageDescription id="xxx" name="packageName">
<resources>
<component id="xxx" name="componentName" path="/Component/" size="406,50"/>
<image id="xxx" name="imageName" path="/Resources/res/" size="100,32"/>
<atlas id="xxx" size="2048,1024" file="atlas0.png"/>
</resources>
</packageDescription>

要回复问题请先登录注册