DOTween 版本 1.2.420 免费版
C# 导出的配置文件,添加 DOTween 的类
// DOTween
typeof(DG.Tweening.Sequence),
typeof(DG.Tweening.DOTween),
typeof(DG.Tweening.DOTweenModuleSprite),
typeof(DG.Tweening.DOTweenModuleUI),
typeof(DG.Tweening.ShortcutExtensions),
typeof(DG.Tweening.TweenExtensions),
typeof(DG.Tweening.TweenSettingsExtensions),
typeof(DG.Tweening.Ease),
TS 代码里添加代码
// DOTween 的扩展
(function () {
$extension(UnityEngine.Component, DG.Tweening.ShortcutExtensions);
$extension(UnityEngine.Transform, DG.Tweening.ShortcutExtensions);
$extension(DG.Tweening.Tween, DG.Tweening.TweenExtensions);
$extension(DG.Tweening.Sequence, DG.Tweening.TweenSettingsExtensions);
$extension(UnityEngine.UI.Image, DG.Tweening.DOTweenModuleUI);
$extension(UnityEngine.UI.Text, DG.Tweening.DOTweenModuleUI);
$extension(UnityEngine.RectTransform, DG.Tweening.DOTweenModuleUI);
$extension(UnityEngine.SpriteRenderer, DG.Tweening.DOTweenModuleSprite);
let TweenerVector3 = $generic(DG.Tweening.Core.TweenerCore$3, UnityEngine.Vector3, UnityEngine.Vector3, DG.Tweening.Plugins.Options.VectorOptions);
$extension(TweenerVector3, DG.Tweening.TweenSettingsExtensions);
let TweenerVector2 = $generic(DG.Tweening.Core.TweenerCore$3, UnityEngine.Vector2, UnityEngine.Vector2, DG.Tweening.Plugins.Options.VectorOptions);
$extension(TweenerVector2, DG.Tweening.TweenSettingsExtensions);
let TweenerString = $generic(DG.Tweening.Core.TweenerCore$3, System.String, System.String, DG.Tweening.Plugins.Options.StringOptions);
$extension(TweenerString, DG.Tweening.TweenSettingsExtensions);
let TweenerQuaternion = $generic(DG.Tweening.Core.TweenerCore$3, UnityEngine.Quaternion, UnityEngine.Quaternion, DG.Tweening.Plugins.Options.QuaternionOptions);
$extension(TweenerQuaternion, DG.Tweening.TweenSettingsExtensions);
let TweenerColor = $generic(DG.Tweening.Core.TweenerCore$3, UnityEngine.Color, UnityEngine.Color, DG.Tweening.Plugins.Options.ColorOptions);
$extension(TweenerColor, DG.Tweening.TweenSettingsExtensions);
})();
使用过程中,暂时只发现 DOScale 调用有问题,改成 DOScaleX 和 DOScaleY 后,就没问题了,原因未知
调用 DOScale 时的报错信息
DOTWEEN ► Tween startup failed (NULL target/property - UnityEngine.Vector2 <DOScale>b__0()): the tween will now be killed ► Object reference not set to an instance of an object
UnityEngine.Debug:LogWarning(Object)
DG.Tweening.Core.Debugger:LogWarning(Object, Tween) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/Debugger.cs:46)
DG.Tweening.Tweener:DoStartup(TweenerCore`3) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Tweener.cs:138)
DG.Tweening.Core.TweenerCore`3:Startup() (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenerCore.cs:230)
DG.Tweening.Core.TweenManager:Update(UpdateType, Single, Single) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:446)
DG.Tweening.Core.DOTweenComponent:Update() (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs:75)