@Harald Thanks for reply.I will try my best to describe the trouble I have encountered and the help I want to get(with ai translations) .
1, our team artists loves the physical feature in 4.2:
2, it works in unity(2022.3.40f1) with spine4.2 runtime. But it dosn't works while SkeletonAnimation.timescale = 0;
[SerializeField] private SkeletonAnimation image;
image.timeScale = 0;
this equals to
Set Component(SkeletonAnimation) Time Scale to 0 in inspector.
3, i need to set it to 0 cuz i need to control animation playing by my deltaTime, like this:
`
public TimelineNode DoActionOnce(string actionId, string key, out float inSec, out List<(string key, float elapsed)> eventPoints)
{
inSec = 0;
eventPoints = new List<(string key, float elapsed)>();
if (_imageData == null) return TimelineNode.Nothing;
Spine.Animation sa = _imageData.FindAnimation(actionId);
if (sa == null || sa.Duration <= 0) return TimelineNode.Nothing;
inSec = sa.Duration;
if (!string.IsNullOrEmpty(key))
{
var tls = sa.Timelines.FindAll(t => t is EventTimeline);
foreach (Spine.Timeline t in tls)
{
EventTimeline et = (EventTimeline)t;
foreach (Spine.Event se in et.Events)
{
//判断se中是否带有key,如果是,才有可能,约定key的string后面+个"_"才是搜索关键字
if (se.Data.Name.Contains(key + "_"))
{
//se.Time是发生的时间点,动画开始后算起(秒)
eventPoints.Add((se.Data.Name, se.Time));
}
}
}
eventPoints.Sort((ep1, ep2)=>ep1.elapsed.CompareTo(ep2.elapsed));
}
float elapsed = 0;
float totalInSec = inSec;
return new TimelineNode(e =>
{
if (!image || !gameObject) return true;
if (e <= 0)
{
image.AnimationState.SetAnimation(0, actionId, false);
elapsed = 0;
}
image.AnimationState.Update(e - elapsed);
elapsed = e;
if (e >= totalInSec)
{
image.AnimationState.SetAnimation(0, _defaultAction, true);
return true;
}
return false;
});
}`
in a timelineNode(not unity timeline but classic JRPG timeline),i update the animation by my own deltaTime that i can do many things like faster or slower the game running. and every timelineNode is only a part of the performance for a turn after player gives command.
4, a battle turn performance in our game is nearly Unicorn Overlord:
from 3:10 to 3:35, the whole battle turn performance is composed of many individual timeline nodes that are very complex. Each one is calculated through separate script logic. I need to calculate it well at the beginning, and then gradually play it for players to watch. During the process, players can freely speed up or slow down the playback. So I have to set timeScale to 0, otherwise it will update twice by unity mono update.
5, And then, SkeletonAnimation.timeScale == 0 leads to physical stop working. I just wanna the character can have drag effect(artists makes them in spine4.2) while character moving and their SkeletonAnimation.timeScale==0.
So I think I should be given another update that allows me to set it to 1 so that I can fully enjoy the new physical characteristics in 4.2.