示例#1
0
    private void SetAnimation(GameObject blockAnimation, bool canOverride, bool disableSounds)
    {
        if (canOverride)
        {
            this.ClearAnimation(true);
            this.animationQueue.Clear();
        }

        AnimationQueueContainer animationQueueContainer = new AnimationQueueContainer(blockAnimation, disableSounds);

        this.animationQueue.Enqueue(animationQueueContainer);
    }
示例#2
0
    private void Update()
    {
        if (this.nextAnimation != null)
        {
            if (this.ClearAnimation(false))
            {
                this.SetNewAnimation(this.nextAnimation.Animation, this.nextAnimation.DisableSounds);
                this.nextAnimation = null;
            }
        }
        else if (this.nextAnimation == null && this.animationQueue.Count > 0)
        {
            this.nextAnimation = this.animationQueue.Dequeue();

            if (this.ClearAnimation(false))
            {
                this.SetNewAnimation(this.nextAnimation.Animation, this.nextAnimation.DisableSounds);
                this.nextAnimation = null;
            }
        }
    }