我用的最新的DoTween 1.2.420,已经在ilhelper.cs里面加了1楼的代码,在Hotfix里面使用Dotween,我要tween的是一个float值,报错,提示我还需要加别的委托?
我的代码
DOTween.To(() => value, newValue => value = newValue, 0, 1);
报错的主要内容
System.Collections.Generic.KeyNotFoundException: Cannot find Delegate Adapter for:ETHotfix.UILoginWolfComponent/<>c__DisplayClass61_0.<GameLog>b__0(), Please add following code:
appdomain.DelegateManager.RegisterFunctionDelegate<System.Single>();
重复了几次,加了以下的代码后,就可以运行了。
appdomain.DelegateManager.RegisterFunctionDelegate<System.Single>();
appdomain.DelegateManager.RegisterDelegateConvertor<DG.Tweening.Core.DOGetter<System.Single>>((act) =>
{
return new DG.Tweening.Core.DOGetter<System.Single>(() =>
{
return ((Func<System.Single>)act)();
});
});
appdomain.DelegateManager.RegisterMethodDelegate<System.Single>();
appdomain.DelegateManager.RegisterDelegateConvertor<DG.Tweening.Core.DOSetter<System.Single>>((act) =>
{
return new DG.Tweening.Core.DOSetter<System.Single>((pNewValue) =>
{
((Action<System.Single>)act)(pNewValue);
});
});