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);
     }
 }
    public void CallLerpPosition()
    {
        // Arrange
        PlayerSync playerSync = new PlayerSync();
        var playerSyncInterface = GetPlayerSyncMock();
        playerSync.SetPlayerSync(playerSyncInterface);
        Vector3 testVector = new Vector3(1, 1, 1);

        // Act
        playerSync.CallLerpPosition(testVector);

        // Assert
        playerSyncInterface.Received().LerpPosition(testVector, 15f);
    }
Exemple #3
0
    public void CallLerpPosition()
    {
        // Arrange
        PlayerSync playerSync          = new PlayerSync();
        var        playerSyncInterface = GetPlayerSyncMock();

        playerSync.SetPlayerSync(playerSyncInterface);
        Vector3 testVector = new Vector3(1, 1, 1);

        // Act
        playerSync.CallLerpPosition(testVector);

        // Assert
        playerSyncInterface.Received().LerpPosition(testVector, 15f);
    }