示例#1
0
    /// <summary>
    /// Plays the current fade animation with the specified time.
    /// </summary>
    /// <param name='animationTime'>
    /// Animation time.
    /// </param>
    protected void PlayFadeAnimation(float animationTime)
    {
        if (cachedAnimation != null)
        {
            if ((currentAnimation == animFadeIn && cachedRenderWrapper.GetAlpha(cachedRender) < 0.1f) ||
                (currentAnimation == animFadeOut && cachedRenderWrapper.GetAlpha(cachedRender) > 0.9f))
            {
                SetSpeedBasedOnDuration(currentAnimation, animationTime);
                cachedAnimWrapper.PlayAnimation(cachedAnimation, currentAnimation);
            }
        }

        StartCoroutine("CheckPlaying");
    }