Ejemplo n.º 1
0
        public void BlendAnimation(MafiaAnimation anim, int startFrame = 0, int endFrame = 0, float blendDuration = 0.25f)
        {
            if (anim == null)
            {
                return;
            }

            if (mafiaAnimation == anim)
            {
                return;
            }

            anim.Reset();

            if (mafiaAnimation == null)
            {
                mafiaAnimation            = anim;
                mafiaAnimation.startFrame = startFrame;
                mafiaAnimation.endFrame   = endFrame;
                return;
            }

            pairAnimation = anim;
            pairAnimation.blendDuration = blendDuration;
            pairAnimation.startFrame    = startFrame;
            pairAnimation.endFrame      = endFrame;
        }
Ejemplo n.º 2
0
        public void AnimReset()
        {
            if (mafiaAnimation == null || mafiaAnimation.animationSequences == null)
            {
                return;
            }

            mafiaAnimation.Reset();
        }
Ejemplo n.º 3
0
        public void SetAnimation(MafiaAnimation anim, int startFrame = 0, int endFrame = 0)
        {
            if (mafiaAnimation == anim)
            {
                return;
            }

            if (anim != null)
            {
                anim.Reset();
            }

            mafiaAnimation            = anim;
            mafiaAnimation.startFrame = startFrame;
            mafiaAnimation.endFrame   = endFrame;
        }
Ejemplo n.º 4
0
        public void SetAnimation(MafiaAnimation anim, int startFrame = 0, int endFrame = 0)
        {
            if (mafiaAnimation == anim)
            {
                return;
            }

            if (anim != null)
            {
                anim.Reset();
            }

            mafiaAnimation            = anim;
            mafiaAnimation.startFrame = startFrame;
            mafiaAnimation.endFrame   = endFrame;

            // save the positon of object at the beggining of animation
            this.objectInitialPosition = gameObject.transform.parent.position;
        }