mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
remove vel callback
This commit is contained in:
parent
8eb75f39fc
commit
ec3703ec5e
@ -82,17 +82,6 @@ void OnValidate()
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
public override void OnStartClient()
|
||||
{
|
||||
if (!isLocalPlayer)
|
||||
NTReliableExt.VelRotChangedAction = OnVelRotChanged;
|
||||
}
|
||||
|
||||
public override void OnStopClient()
|
||||
{
|
||||
NTReliableExt.VelRotChangedAction = null;
|
||||
}
|
||||
|
||||
public override void OnStartAuthority()
|
||||
{
|
||||
characterController.enabled = true;
|
||||
@ -230,20 +219,5 @@ void HandleMove()
|
||||
// Finally move the character.
|
||||
characterController.Move(direction * Time.deltaTime);
|
||||
}
|
||||
|
||||
void OnVelRotChanged(Vector3 newVelocity, Vector3 newRotation)
|
||||
{
|
||||
// Only apply to other player objects
|
||||
if (isLocalPlayer) return;
|
||||
|
||||
animVelocity = -transform.InverseTransformDirection(newVelocity).z / moveSpeedMultiplier;
|
||||
animRotation = -newRotation.y / maxTurnSpeed;
|
||||
|
||||
if (animator)
|
||||
{
|
||||
animator.SetFloat("Forward", Mathf.MoveTowards(animator.GetFloat("Forward"), animVelocity, moveSpeedMultiplier * Time.deltaTime));
|
||||
animator.SetFloat("Turn", Mathf.MoveTowards(animator.GetFloat("Turn"), animRotation, maxTurnSpeed * Time.deltaTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user