using System.Collections.Generic; using UnityEngine; namespace Core.UI.UTool.UITween { public class TweenTextMeshProUGUI: TweenBasic { public enum TweenTextMeshProUGUIType { Al, } public class TweenTextMeshProUGUIInfo { public TweenRectTransformType TweenRectTransformType; public TweenLerpType TweenLerpType; public Vector3 Start; public Vector3 End; public AnimationCurve startX=new AnimationCurve(); public AnimationCurve startY=new AnimationCurve(); public AnimationCurve startZ=new AnimationCurve(); } // public RectTransform RectTransform; public List TweenRectTransformInfos = new List(); public RectTransform GetRectTransform(Object RectTransform) { RectTransform rectTransform = RectTransform as RectTransform; if (rectTransform == null) { GameObject gameObject = RectTransform as GameObject; if (gameObject != null) { rectTransform = gameObject.GetComponent(); } } return rectTransform; } protected override void ProPlay(Object RectTransform, float allTime) { RectTransform rectTransform = GetRectTransform(RectTransform); if (rectTransform == null) { return; } float t = _addTime * allTime; if (t > 1) { t = 1; } for (int i = 0; i < TweenRectTransformInfos.Count; i++) { TweenRectTransformInfos[i].Play(rectTransform, t); } } protected override void ProRest(Object RectTransform) { RectTransform rectTransform = GetRectTransform(RectTransform); if (rectTransform == null) { return; } for (int i = 0; i < TweenRectTransformInfos.Count; i++) { TweenRectTransformInfos[i].Rest(rectTransform); } } } }