mxwin30001

public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
base.ProcessFrame(playable, info, playerData);

if (playerData != null)
{
SkeletonAnimation skeletonAnimation = playerData as SkeletonAnimation;
if (skeletonAnimation != null && skeletonAnimation.AnimationState != null)
{
TrackEntry trackEntry = skeletonAnimation.AnimationState.GetCurrent(0);
if (trackEntry != null)
{
skeletonAnimation.timeScale = 0;
trackEntry.TrackTime = (float) playable.GetTime();
skeletonAnimation.timeScale = 1;
}
}
}
}

我再timeline中,通过滑动模块设置动画的时间位置trackEntry.TrackTime。但是经常需要滚动一下鼠标,动画才能定位到正确位置,请问如何解决
mxwin30001
  • 記事: 1

Harald

恐怕机器翻译无法正确翻译您的问题。不幸的是,我不太了解您要达到的目标。

机器翻译表明您正在尝试将时间轴光标定位在精确的位置,并且需要滚动查找所需的精确时间。如果是这样:为什么会出现问题?您想如何通过代码解决此问题?

为什么要在代码中将Playable'的时间分配给trackEntry.TrackTime`? Spine时间轴扩展程序将自动为TrackEntry分配相应的可播放时间,为什么还要在代码中第二次执行此操作?

您尝试使用发布的代码实现什么?您在哪种情况下使用此代码?确保该代码被调用的周围的类是什么?

如果我们误解了您的机器翻译问题,请告知我们。如果是这样,您能否详细描述您要达到的目标?

请注意,您可以通过使用周围的
[code]your-code-goes-here[/code]
标签来发布带有格式的代码。
-----
I'm afraid machine translation failed translating your question properly. Unfortunately I don't quite understand what you are trying to achieve.

Machine translation states that you are trying to position the Timeline cursor at a precise position and that you need to scroll to find the precise time that you want. If this is the case: why is this a problem? And how do you want to solve this problem via code?

Why are you assigning Playable's time to the trackEntry.TrackTime in your code? The Spine Timeline extension will already automatically assign the corresponding Playable time to the TrackEntry, why are you doing this a second time in your code?

What are your trying to achieve with the code you posted? In which context are you using this code? What is the surrounding class that ensures this code gets called?

Please let us know if we misunderstood your machine-translated question. If that's the case, could you please describe what you are trying to achieve in more detail?

Please note that you can post code with formatting by using the
[code]your-code-goes-here[/code]
tags around it.
アバター
Harald

Harri
  • 記事: 3479


Return to 中国Spine用户