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; }
public void AnimReset() { if (mafiaAnimation == null || mafiaAnimation.animationSequences == null) { return; } mafiaAnimation.Reset(); }
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; }
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; }