Skip to content

DOTween (JavaScript)

DOTween

Scripting Name:Insight.DOTween

DOTween 动画类。

  • _在 Web _SDK__中无效

Static Methods


DOColor

javascript
public static Insight.Tweener DOColor(Insight.Material mat, Insight.Vector4 colorTo, number duration);

对材质主颜色进行插值动画。

Parameters

javascript
// sample:
Insight.DOTween.DOColor(this.material, Insight.Vector4.New(0.0, 1.0, 0.0, 1.0), 1.5).setLoops(10).setEase(Insight.Ease.InOutCubic);

DOColor

javascript
public static Insight.Tweener DOColor(Insight.Material mat, Insight.Vector4 colorTo, string pro_name, number duration);

对材质颜色进行插值动画。

Parameters

  • mat : Insight.Material 材质
  • colorTo : Insight.Vector4 动画最终的属性值
  • pro_name : string 颜色属性名称
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener

DOVector

javascript
public static Insight.Tweener DOVector(Insight.Material mat, Insight.Vector4 vectorTo, string pro_name, number duration);

对材质的 Vector4 属性进行插值动画。

Parameters

  • mat : Insight.Material 材质
  • colorTo : Insight.Vector4 动画最终的属性值
  • pro_name : string Vector4 属性名称
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener

DOFloat

javascript
public static Insight.Tweener DOFloat(Insight.Material mat, number floatTo, string pro_name, number duration);

对材质的 float 属性进行插值动画。

Parameters

  • mat : Insight.Material 材质
  • floatTo : number 动画最终的属性值
  • pro_name : string float 属性名称
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener
javascript
// sample:
Insight.DOTween.DOFloat(this.material, 1.0, "_ForRadiusAnim", 1.5).setLoops(10, Insight.LoopType.Yoyo).setEase(Insight.Ease.Linear);

DOMove

javascript
public static Insight.Tweener DOMove(Insight.Transform transform, Insight.Vector3 moveTo, number duration);

对物体进行世界空间移动的插值动画。

Parameters

DOLocalMove

javascript
public static Insight.Tweener DOLocalMove(Insight.Transform transform, Insight.Vector3 moveTo, number duration);

对物体进行局部空间移动的插值动画。

Parameters

javascript
// sample:
Insight.DOTween.DOLocalMove(this.transform, Insight.Vector3.New(-1.0, 0.0, 0.0), 2.0).setLoops(-1, Insight.LoopType.Yoyo).setEase(Insight.Ease.InOutCubic);

DORotate

javascript
public static Insight.Tweener DORotate(Insight.Transform transform, Insight.Vector3 rotateTo, number duration);

对物体进行世界空间旋转的插值动画。

Parameters

  • transform : Insight.Transform 物体的 transform
  • rotateTo : Insight.Vector3 世界空间中最终旋转到的欧拉角
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener

DOLocalRotate

javascript
public static Insight.Tweener DOLocalRotate(Insight.Transform transform, Insight.Vector3 rotateTo, number duration);

对物体进行局部空间旋转的插值动画。

Parameters

  • transform : Insight.Transform 物体的 transform
  • rotateTo : Insight.Vector3 局部空间中最终旋转到的欧拉角
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener

DOLocalScale

javascript
public static Insight.Tweener DOLocalScale(Insight.Transform transform, Insight.Vector3 scaleTo, number duration);

对物体进行局部空间缩放的插值动画。

Parameters

  • transform : Insight.Transform 物体的 transform
  • rotateTo : Insight.Vector3 局部空间中最终缩放到的大小
  • duration : number 动画持续时间(单位:秒/s) 返回一个 Tweener