关于在Xlua中使用DoTween插件的拓展方法(包括UGUI模块方法)

实现步骤


使用 [LuaCallCSharp]和 [ReflectionUse]属性包裹住一个静态的类型为List《Type》的变量
将大部分DG.Tweening命名空间中的类都包裹进来并生成。
网上的大部分帖子都是这样的,但是他并没有贴完整,简直是误导了一半的人人,像网上的帖子那么干只能使用到最基础的Transform的拓展方法,而像是UGUI中的图片,文本,或者AudioSource调用Dotween的方法都会报空,那是因为网上并没有写完整,如果想要使用其他的模块,就要将这些模块也囊括在这个静态列表中,代码如下:

    [LuaCallCSharp]
    [ReflectionUse]
    public static List<Type> dotween_lua_call_cs_list = new List<Type>()
    {
        typeof(DG.Tweening.AutoPlay),
        typeof(DG.Tweening.AxisConstraint),
        typeof(DG.Tweening.Ease),
        typeof(DG.Tweening.LogBehaviour),
        typeof(DG.Tweening.LoopType),
        typeof(DG.Tweening.PathMode),
        typeof(DG.Tweening.PathType),
        typeof(DG.Tweening.RotateMode),
        typeof(DG.Tweening.ScrambleMode),
        typeof(DG.Tweening.TweenType),
        typeof(DG.Tweening.UpdateType),

        typeof(DG.Tweening.DOTween),
        typeof(DG.Tweening.DOVirtual),
        typeof(DG.Tweening.EaseFactory),
        typeof(DG.Tweening.Tweener),
        typeof(DG.Tweening.Tween),
        typeof(DG.Tweening.Sequence),
        typeof(DG.Tweening.TweenParams),
        typeof(DG.Tweening.Core.ABSSequentiable),

        typeof(DG.Tweening.Core.TweenerCore<Vector3, Vector3, DG.Tweening.Plugins.Options.VectorOptions>),
        typeof(DG.Tweening.Core.TweenerCore<Color,Color,DG.Tweening.Plugins.Options.ColorOptions>),
        typeof(DG.Tweening.Core.TweenerCore<float,float,DG.Tweening.Plugins.Options.FloatOptions>),

        typeof(DG.Tweening.TweenCallback),
        typeof(DG.Tweening.TweenExtensions),
        typeof(DG.Tweening.TweenSettingsExtensions),
        typeof(DG.Tweening.ShortcutExtensions),
        typeof(DG.Tweening.DOTweenModuleUI),
        //有了以下这部分才能真正使用其他模块的拓展方法,这是其他帖子都没写的
        typeof(DG.Tweening.DOTweenModuleSprite),
        typeof(DG.Tweening.DOTweenModuleAudio),
       typeof(DG.Tweening.DOTweenModulePhysics),
       typeof(DG.Tweening.DOTweenModulePhysics2D)
}

找了半天的错误,真的是无语了。。各位大佬发帖子就应该说清楚一点才对。。都讲了一半

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值