关于xlua 中调取unity Button 组件中的interactable 会报错 - attempt to call a boolean value (field 'interactable')

笔者遇到了 xlua使用unity 中的组建中的interactable 

这样写的 tishiban_jia1 为一个组件

tishiban_jia1.interactable = false

结果报出了  attempt to call a boolean value (field 'interactable')的错误

因为是非静态的方法,所以我们改成下面这样

tishiban_jia1:interactable = false

但是遗憾的是是 还是  attempt to call a boolean value (field 'interactable')的错误

于是就找到了 xlua中的教学c#转化xlua引用的代码 路径在xlua-Examples-ExampleGenConfig.cs

打开之后在其中间添加 引用命名空间

然后加入Button 截图如下

然后再 xlua 中清除配置  然后生成配置    --在运行发现问题不存在了

扫描二维码关注公众号,回复: 8893546 查看本文章

发布了65 篇原创文章 · 获赞 18 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/huhudeni/article/details/83000053