void RefreshPreview()
    {
        mAnimationSprite = null;

        if (mAnimation.atlas != null)
        {
            bool isPlayingIgnored = true;
            mAnimationSpriteId = GiraffeSpriteAnimation.Animate(mAnimation, mAnimationTime, ref isPlayingIgnored);
            mAnimationSprite   = mAnimation.frameSprites[mAnimationSpriteId];
        }
    }
Exemple #2
0
    void UpdateAnimation()
    {
        if (mSpriteAnimation == null)
        {
            return;
        }

        int frame = GiraffeSpriteAnimation.Animate(mSpriteAnimation, mTime, ref mPlaying);

        if (frame != mCurrentFrame)
        {
            GiraffeSprite sprite = mSpriteAnimation.frameSprites[frame];
            mRenderer.sprite = sprite;
            mCurrentFrame    = frame;
        }
    }