public void SendAnim(ProcAnimation anim) { if (!hasAnim) { currentAnimation = anim; anim.Init(); hasAnim = true; if (anim.startFromPos == false) { foreach (AnimSegment segment in anim.animSegs) { foreach (AnimSegment oldSegment in lastAnim.animSegs) { if (segment.animType == oldSegment.animType) { segment.procAnimation.SetAnimSegment(segment, GetEnd(oldSegment)); continue; } } } } SendAnimSeg(anim.animSegs); } else { Debug.LogError("ALREADY HAS ANIMATION"); } }
private void Start() { defaultAnim.Init(); lastAnim = defaultAnim; currentAnimation = defaultAnim; SendAnim(idleAnim); }
public void Interupt(ProcAnimation newAnim) { interupted = true; StopAllCoroutines(); interuptedNum = objectPos; EndAnimation(); SendAnim(newAnim); }
public ProcAnimation GetAnim() { ProcAnimation anim = GetAnimRaw(); if (anim.hasEvent) { chainPos = 0; isInChain = false; return(gotParried); //sSS.SwingSword(); } return(anim); }
void EndAnimation() { objectPos = 0; lastAnim = currentAnimation; hasAnim = false; }