public static Directions GetDirection(AnimationKey currentAnimation) { if (currentAnimation.ToString().Contains("North")) { return(Directions.North); } else if (currentAnimation.ToString().Contains("West")) { return(Directions.West); } else if (currentAnimation.ToString().Contains("Lest")) { return(Directions.Lest); } else if (currentAnimation.ToString().Contains("South")) { return(Directions.South); } return(Directions.South); }
private void OverrideAnimation(AnimationKey key, AnimationClip animation) { string keyString = key.ToString(); KeyValuePair <AnimationClip, AnimationClip> @override; if (m_overrides.TryGetValue(keyString, out @override)) { m_overrides[keyString] = new KeyValuePair <AnimationClip, AnimationClip>(@override.Key, animation); } else { Debug.LogWarningFormat("Couldn't find {0} in the m_animator", keyString); } }
public void IdleAnimation() { isAnimating = false; string anime = CurrentAnimation.ToString(); if (anime.Contains("North")) { CurrentAnimation = AnimationKey.North; } else if (anime.Contains("West")) { CurrentAnimation = AnimationKey.West; } else if (anime.Contains("Lest")) { CurrentAnimation = AnimationKey.Lest; } else { CurrentAnimation = AnimationKey.South; } }