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

xiaoxiao2021-08-27  423

笔者遇到了 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 中清除配置  然后生成配置    --在运行发现问题不存在了

转载请注明原文地址: https://www.6miu.com/read-4823562.html

最新回复(0)