赞
踩
因为我们使用了ILRuntime热更,unity 打出的WebGL包,运行就会报找不到DoTween里面的方法,所以吧DoTween拓展到tranform类里面,这样就不会报错了,下面是示例
using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public static class ExtensionMethod { /// <summary> /// 把DOLocalMoveX 拓展到Tranform类里 /// </summary> /// <param name="target"></param> /// <param name="endValue"></param> /// <param name="duration"></param> /// <returns></returns> public static Tweener TFDOLocalMoveX(this Transform target, float endValue, float duration) { return target.DOLocalMoveX(endValue, duration); } }
使用方法 直接tranform点出来就可以
其他类拓展同理
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。