/// <summary> /// Returns the if the Next or Current Animator State is tagged: tag /// </summary> public virtual bool RealAnimatorState(string tag, int layerIndex = 0) { if (layerIndex == 0) { return(NextAnimState.IsTag(tag) || CurrentAnimState.IsTag(tag)); } else { return(Anim.GetNextAnimatorStateInfo(layerIndex).IsTag(tag) || Anim.GetCurrentAnimatorStateInfo(layerIndex).IsTag(tag)); } }
/// <summary> /// This will check is the Animal is in any Jump State /// </summary> /// <param name="normalizedTime">The normalized time of the Jump Animation</param> /// <param name="half">True to check if is the First Half, False to check the Second Half</param> /// <returns></returns> public virtual bool isJumping(float normalizedTime, bool half) { if (half) //if is jumping the first half { if (CurrentAnimState.IsTag("Jump")) { if (CurrentAnimState.normalizedTime <= normalizedTime) { return(true); } } if (NextAnimState.IsTag("Jump")) //if is transitioning to jump { if (NextAnimState.normalizedTime <= normalizedTime) { return(true); } } } else //if is jumping the second half { if (CurrentAnimState.IsTag("Jump")) { if (CurrentAnimState.normalizedTime >= normalizedTime) { return(true); } } if (NextAnimState.IsTag("Jump")) //if is transitioning to jump { if (NextAnimState.normalizedTime >= normalizedTime) { return(true); } } } return(false); }
/// <summary> /// Returns the if the Next or Current Animator State is tagged: tag /// </summary> public virtual bool RealAnimatorState(string tag) { return(NextAnimState.IsTag(tag) || CurrentAnimState.IsTag(tag)); }