remove vel callback

This commit is contained in:
vis2k 2023-01-27 00:01:08 +09:00
parent 8eb75f39fc
commit ec3703ec5e

View File

@ -82,17 +82,6 @@ void OnValidate()
this.enabled = false; this.enabled = false;
} }
public override void OnStartClient()
{
if (!isLocalPlayer)
NTReliableExt.VelRotChangedAction = OnVelRotChanged;
}
public override void OnStopClient()
{
NTReliableExt.VelRotChangedAction = null;
}
public override void OnStartAuthority() public override void OnStartAuthority()
{ {
characterController.enabled = true; characterController.enabled = true;
@ -230,20 +219,5 @@ void HandleMove()
// Finally move the character. // Finally move the character.
characterController.Move(direction * Time.deltaTime); 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));
}
}
} }
} }