YiHe_AllVersion/YHWeb/Assets/YHElectric/Scripts/Helper/DoTweenAnim.cs

52 lines
1.5 KiB
C#

using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace YHElectric
{
public enum DoTweenAnimType
{
Alph,
Scale,
Translate,
Rotate
}
public class DoTweenAnim
{
public static Tweener Enter(Transform trans,float timer, DoTweenAnimType doTweenAnimType,Ease ease)
{
Tweener tweener = null ;
switch (doTweenAnimType)
{
case DoTweenAnimType.Alph:
break;
case DoTweenAnimType.Scale:
tweener=trans.DOScale(Vector3.one,timer).SetEase(ease);
break;
case DoTweenAnimType.Translate:
break;
case DoTweenAnimType.Rotate:
break;
}
return tweener;
}
public static Tweener Exit(Transform trans, float timer, DoTweenAnimType doTweenAnimType, Ease ease)
{
Tweener tweener = null;
switch (doTweenAnimType)
{
case DoTweenAnimType.Alph:
break;
case DoTweenAnimType.Scale:
tweener = trans.DOScale(Vector3.one, timer).SetEase(ease);
break;
case DoTweenAnimType.Translate:
break;
case DoTweenAnimType.Rotate:
break;
}
return tweener;
}
}
}