void Update() { if (type == _AniType.None) { return; } if (type == _AniType.Legacy && aniInstance != null) { if (unitCreep.stunned) { aniInstance.GetComponent <Animation>()[clipMove.name].speed = 0; } else { aniInstance.GetComponent <Animation>()[clipMove.name].speed = unitCreep.GetMoveSpeed() * moveSpeedMultiplier; } } if (type == _AniType.Mecanim && anim != null) { anim.SetFloat("Speed", unitCreep.GetMoveSpeed()); } }