Beispiel #1
0
    protected virtual void OnPositionRotationUpdate(MatchSimulationUnit.MovementProperties movementProperties)
    {
        InterpolationState stateToAdd = new InterpolationState(movementProperties.GetUnityPosition(), movementProperties.GetUnityRotation(),
                                                               (byte)MathHelper.Modulo(movementProperties.Frame + FrameDelay, byte.MaxValue));

        //DIContainer.Logger.Debug("OnUnitStateUpdate state: " + stateToAdd);

        interpolationQueue.Enqueue(stateToAdd);
    }
Beispiel #2
0
    protected override void OnPositionRotationUpdate(MatchSimulationUnit.MovementProperties movementProperties)
    {
        Vector3 targetPosition = movementProperties.GetUnityPosition();

        float distance = Vector3.Distance(transform.position, targetPosition);

        continousPositionChangeFrames = Mathf.Clamp((distance > 0f ? 5 : continousPositionChangeFrames - 1), 0, 3);

        animator.SetBool("Running", continousPositionChangeFrames > 0);
        transform.position = targetPosition;

        if (currentAbilityActivation == null)
        {
            modelRoot.transform.rotation = movementProperties.GetUnityRotation();
        }

        return;
    }