private void ToFree(LocomoteFreeParams param) { LayerWeightTarget = 1; StopLocomotionWithAgent(); rb.isKinematic = false; LocomType = PredefinedLocomType.FreeWithKeys; TurnToTransform = null; MoveToTransformWithAgent = null; if (param.LocomStyleIndex >= 0) { SetLocomotionStyle(param.LocomStyleIndex); } else { SetLocomotionStyle(player.defaultLocomStyleIndex); Debug.Log("No locomotion style found with this index, default will be used!"); } if (player.Animator.GetFloat("VelX") > .5f) { player.Animator.SetFloat("VelX", .5f); } else { player.Animator.SetFloat("VelX", 0f); } if (player.Animator.GetFloat("VelY") > .5f) { player.Animator.SetFloat("VelY", .5f); } else { player.Animator.SetFloat("VelY", 0f); } }
public void OverrideLocomoteFree(LocomoteFreeParams param, short priority, string id) { LocomTypeDict.Override(id, priority, param); if (LocomTypeDict.LastId == id) { ToFree(param); } }