예제 #1
0
    private void Finish()
    {
        Anim(1);

        if (sendMessageOnFinish)
        {
            GameObject receiver = gameObject;
            if (messageReceiver != null)
            {
                receiver = messageReceiver;
            }

            receiver.SendMessage(messageName);
        }

        if (playAnimationOnFinish && !string.IsNullOrEmpty(playAnimationOnFinishName))
        {
            MadAnim.PlayAnimation(gameObject, playAnimationOnFinishName, playAnimationOnFinishFromTheBeginning);
        }

        if (destroyObjectOnFinish)
        {
            MadGameObject.SafeDestroy(gameObject);
        }
        isPlaying = false;

        if (!string.IsNullOrEmpty(animationQueue))
        {
            PlayAnimationNow(gameObject, animationQueue);
        }
    }
예제 #2
0
        private void PlayAnimations(GameObject parent)
        {
            for (int i = 0; i < playAnimations.Count; ++i)
            {
                var    anim  = playAnimations[i];
                string name  = anim.name;
                bool   reset = anim.fromTheBeginning;

                int playedCount = MadAnim.PlayAnimation(parent, name, reset);
                if (playedCount == 0)
                {
                    Debug.LogWarning("There's no animation with name '" + name + "'.");
                }
            }
        }