本文整理汇总了C#中UVAnimation.PlayInReverse方法的典型用法代码示例。如果您正苦于以下问题:C# UVAnimation.PlayInReverse方法的具体用法?C# UVAnimation.PlayInReverse怎么用?C# UVAnimation.PlayInReverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UVAnimation
的用法示例。
在下文中一共展示了UVAnimation.PlayInReverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayAnimInReverse
/// <summary>
/// Like PlayAnim, but plays the animation in reverse.
/// See <see cref="PlayAnim"/>.
/// </summary>
/// <param name="anim">Reference to the animation to play in reverse.</param>
/// <param name="frame">The zero-based index of the frame at which to start playing.</param>
public void PlayAnimInReverse(UVAnimation anim, int frame)
{
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
if (deleted || !gameObject.activeInHierarchy)
#else
if (deleted || !gameObject.active)
#endif
return;
if (!m_started)
Start();
curAnim = anim;
curAnim.Reset();
curAnim.PlayInReverse();
curAnim.SetCurrentFrame(frame + 1); // curFrame inside UVAnimation will be decremented before it is used, so anticipate this by decrementing by 1
// Ensure the framerate is not 0 so we don't
// divide by zero:
anim.framerate = Mathf.Max(0.0001f, anim.framerate);
timeBetweenAnimFrames = 1f / anim.framerate;
timeSinceLastFrame = timeBetweenAnimFrames;
// Only add to the animated list if
// the animation has more than 1 frame:
if (anim.GetFrameCount() > 1)
{
StepAnim(0);
// Start coroutine
if (!animating)
{
//animating = true;
AddToAnimatedList();
//StartCoroutine(AnimationPump());
}
}
else
{
// Since this is a single-frame anim,
// call our delegate before setting
// the frame so that our behavior is
// consistent with multi-frame anims:
if (animCompleteDelegate != null)
animCompleteDelegate(this);
StepAnim(0);
}
}
示例2: PlayAnimInReverse
// Like PlayAnim but plays in reverse:
public void PlayAnimInReverse(UVAnimation anim)
{
// First stop any currently playing animation:
m_manager.StopAnimation(this);
curAnim = anim;
curAnim.Reset();
curAnim.PlayInReverse();
timeBetweenAnimFrames = 1f / anim.framerate;
timeSinceLastFrame = timeBetweenAnimFrames;
StepAnim(0);
m_manager.AnimateSprite(this);
}
示例3: PlayAnimInReverse
/// <summary>
/// Like PlayAnim, but plays the animation in reverse.
/// See <see cref="PlayAnim"/>.
/// </summary>
/// <param name="anim">Reference to the animation to play in reverse.</param>
public void PlayAnimInReverse(UVAnimation anim)
{
curAnim = anim;
curAnim.Reset();
curAnim.PlayInReverse();
// Ensure the framerate is not 0 so we don't
// divide by zero:
anim.framerate = Mathf.Max(0.0001f, anim.framerate);
timeBetweenAnimFrames = 1f / anim.framerate;
timeSinceLastFrame = timeBetweenAnimFrames;
// Only add to the animated list if
// the animation has more than 1 frame:
if (anim.GetFrameCount() > 1)
{
StepAnim(0);
// Start coroutine
if (!animating)
{
//animating = true;
AddToAnimatedList();
//StartCoroutine(AnimationPump());
}
}
else
{
// Since this is a single-frame anim,
// call our delegate before setting
// the frame so that our behavior is
// consistent with multi-frame anims:
if (animCompleteDelegate != null)
animCompleteDelegate(this);
StepAnim(0);
}
}