请问以下大家Lua中怎么添加Unity中的Toggle的事件

  • 请问以下大家Lua中怎么添加Unity中的Toggle的事件,因为Toggle的事件是个泛型委托
    • Toggle事件的委托AddListener(UnityAction<T0> call);
    • Button事件的委托AddListener(UnityAction call);
  • 我尝试了一下只能添加Button的事件

以下是我添加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的配置