You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localDelegateHelper=UnrealClass()
functionDelegateHelper:OnReset()
-- Unbind the delegate when resetself:UnbindDelegate()
end---Bind a callback function to specified delegate.---@paramInDelegateMulticastDelegate Native delegate pointer.---@paramInListenerany Listener instance that holds the callback function.---@paramInCallbackfunction Callback function to trigger.functionDelegateHelper:BindDelegate(InDelegate, InListener, InCallback)
ifnotInDelegatethenreturn--[[]]endInDelegate:Add(self, self.OnNativeDelegateTriggered)
self._NativeDelegate=InDelegateself._Listener=InListenerself._Callback=InCallbackend---Unbind the callback from native delegate.functionDelegateHelper:UnbindDelegate()
ifnotself._NativeDelegatethenreturnendself._NativeDelegate:Remove(self, self.OnNativeDelegateTriggered)
end---Callback function that response to native delegate.---And pass the parameters to lua callback.functionDelegateHelper:OnNativeDelegateTriggered(...)
ifself._Listenerandself._Callbackthenself._Callback(self._Listener, ...)
endendreturnDelegateHelper
在旧版本Unlua中使用辅助脚本可以实现:不与UObject实例绑定的脚本上的函数可以绑定到Dynamic Multicast Delegate上。如下
只需确保上述脚本绑定了UObject,即可使用Lua脚本将回调参数透传给需要的脚本。
但是升级到最新版本Unlua后,增加了
CheckSignatureCompatible()
方法进行了校验,导致上述脚本无法进行绑定。请问有其他方式实现类似的功能吗?
The text was updated successfully, but these errors were encountered: