public IEnumerator ImpactEmphasize() { animationTransform.Pause(); // characterAudioSource.clip = hit; //This should happen via damage // characterAudioSource.Play (); yield return(new WaitForSeconds(.4f)); animationTransform.Unpause(); }
public IEnumerator ImpactEmphasize() { animationTransform.Pause(); lastAttack.TargetActor().CharSheet.TakeDamageEffect(lastAttack.resultingEffect); // characterAudioSource.clip = hit; //This should happen via damage // characterAudioSource.Play (); yield return(new WaitForSeconds(.4f)); //should be loosely the same as the shudder time. Perhaps animationTransform.Unpause(); }
/// <summary> /// Swaps equipment out, and syncs it with whatever is currently playing by setting the normalized time. /// </summary> private IEnumerator EquipmentSwap(EquipmentSlotType slot, EquipmentAnimationControllerName name) { rootAnimationTransform.Pause(); AnimatorStateInfo info = root.GetCurrentAnimatorStateInfo(0); Animator anim = AnimatorFromEquipmentType(slot); SetMappingName(slot, name); RuntimeAnimatorController rt = EquipmentAnimationDispenser.instance.GetAnimationControllerByName(name); // Debug.Log ("swapping "+slot+" animation to this : " + rt.name); anim.runtimeAnimatorController = rt; anim.Play(rootAnimationTransform.LastPlay, 0, info.normalizedTime); yield return(new WaitForEndOfFrame()); rootAnimationTransform.Unpause(); }