Skip to content

Commit

Permalink
fix: simplify ResetEgoToSpawnPoint() function
Browse files Browse the repository at this point in the history
Signed-off-by: Alptuğ Cırıt <[email protected]>
  • Loading branch information
mozhoku committed Mar 11, 2024
1 parent 528b665 commit 9a49173
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Assets/AWSIM/Scripts/UI/HotkeyHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ void Update()
// If the ego transform reference is present, reset the ego to the initial position and rotation.
public void ResetEgoToSpawnPoint()
{
if (_egoTransform == null)
if (!_egoTransform)
{
Debug.LogWarning("Ego transform reference is missing. No ego to reset here!");
return;
}
else
{
_egoTransform.SetPositionAndRotation(_initialEgoPosition, _initialEgoRotation);
_egoRigidbody.Sleep();
}

_egoTransform.SetPositionAndRotation(_initialEgoPosition, _initialEgoRotation);
_egoRigidbody.Sleep();
}
}
}

0 comments on commit 9a49173

Please sign in to comment.