using System.Collections.Generic; using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Options; using LeTai.TrueShadow; using UnityEngine; namespace Core { public static class Extensions { public static bool IsNullOrEmpty(this T[] inArray) => inArray == null || inArray.Length == 0; public static bool IsNullOrEmpty(this IList inList) => inList == null || inList.Count == 0; public static TweenerCore DoFillAmount(this SlicedFilledImage target, float endValue, float duration) { endValue = endValue switch { > 1 => 1, < 0 => 0, _ => endValue }; var tween = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration); tween.SetTarget(target); return tween; } public static TweenerCore DoFade(this TrueShadow target, float endValue, float duration) { var tween = DOTween.ToAlpha(() => target.Color, x => target.Color = x, endValue, duration); tween.SetTarget(target); return tween; } } }