void Update()
 {
     if (!isLocalPlayer && useHistoricalLerping) // if we are not local player then we may have to move so call interface functions
     {
         myRigidbody.position = playerSync.CallHistoricalLerpPosition(myRigidbody.position);
         myRigidbody.rotation = playerSync.CallHistoricalLerpRotation(myRigidbody.rotation);
     }
     else if (!isLocalPlayer)
     {
         myRigidbody.position = playerSync.CallLerpPosition(syncPos);
         myRigidbody.rotation = playerSync.CallLerpRotation(syncRot);
     }
 }
Example #2
0
    public void CallLerpRotation()
    {
        // Arrange
        PlayerSync playerSync          = new PlayerSync();
        var        playerSyncInterface = GetPlayerSyncMock();

        playerSync.SetPlayerSync(playerSyncInterface);
        Quaternion testRot = new Quaternion(0, 0, 0, 0);

        // Act
        playerSync.CallLerpRotation(testRot);

        // Assert
        playerSyncInterface.Received().LerpRotation(testRot, 15f);
    }
    public void CallLerpRotation()
    {
        // Arrange
        PlayerSync playerSync = new PlayerSync();
        var playerSyncInterface = GetPlayerSyncMock();
        playerSync.SetPlayerSync(playerSyncInterface);
        Quaternion testRot = new Quaternion(0, 0, 0, 0);

        // Act
        playerSync.CallLerpRotation(testRot);

        // Assert
        playerSyncInterface.Received().LerpRotation(testRot, 15f);
    }