feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
50
SVSim.BattleEngine/Engine/Wizard/TweenAnimation.cs
Normal file
50
SVSim.BattleEngine/Engine/Wizard/TweenAnimation.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
[ExecuteAlways]
|
||||
public class TweenAnimation : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private float _duration;
|
||||
|
||||
private List<UITweener> _tweenList = new List<UITweener>();
|
||||
|
||||
private bool _isPlaying;
|
||||
|
||||
public void Play()
|
||||
{
|
||||
_isPlaying = true;
|
||||
CollectTween();
|
||||
SetupTweenParam();
|
||||
foreach (UITweener tween in _tweenList)
|
||||
{
|
||||
tween.ResetToBeginning();
|
||||
tween.PlayForward();
|
||||
tween.SetOnFinished(delegate
|
||||
{
|
||||
_isPlaying = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void CollectTween()
|
||||
{
|
||||
_tweenList = base.gameObject.GetComponents<UITweener>().ToList();
|
||||
}
|
||||
|
||||
private void SetupTweenParam()
|
||||
{
|
||||
foreach (UITweener tween in _tweenList)
|
||||
{
|
||||
tween.duration = _duration - tween.delay;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlayEnd()
|
||||
{
|
||||
return !_isPlaying;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user