AddListener(UnityAction<T0> call);
AddListener(UnityAction call);
以下是我添加Toggle事件的lua代码
toggle.onValueChanged:AddListener(self.UpdateClothes);
function ClothesTagView:UpdateClothes(isON)
end
报的错
LuaException: c# exception:System.InvalidCastException: This type must add to CSharpCallLua: UnityEngine.Events.UnityAction<bool>
以下是我添加Button事件的代码
button.onClick:AddListener(self.UpdateClothes2)
function ClothesTagView:UpdateClothes2()
ClothesTagView:UpdateData()
end
是正常的可以使用,点击可以触发事件
[CSharpCallLua]
public static List<Type> cSharpCallLuaList = new List<Type>()
{
typeof(UnityEngine.Events.UnityAction<bool>),
};
把这个加进去就好了,这东西坑了我半天
请问,加到哪个地方啊这块代码
如果是xlua建议参考xlua/doc/xlua的配置