Esempio n. 1
0
    public static void MakeAnimation(ObjectScript animatedObject, float durationSec, Sprite[] sprites, bool playOnce = false, NextAction nextAction = null)
    {
        if (animatedObject == null)
        {
            return;
        }

        if (animatedObject.animationCoroutine != null)
        {
            animatedObject.StopCoroutine(animatedObject.animationCoroutine);
        }

        animatedObject.animationCoroutine =
            animatedObject.StartCoroutine(AnimationCoroutine(animatedObject.spriteRenderer, durationSec, sprites, playOnce, nextAction));
    }