private void RestartLogic() { playerWon = false; Transform playerTransform = transform; Rigidbody rb = playerTransform.GetComponent <Rigidbody>(); playerTransform.position = new Vector3(0f, 1f, 0f); playerTransform.rotation = Quaternion.Euler(0, 0, 0); rb.velocity = new Vector3(0f, 0f, 0f); rb.angularVelocity = new Vector3(0f, 0f, 0f); RestartEvent?.Invoke(); restartInProgress = false; }
internal void OnRestart(int time = 5) => RestartEvent?.Invoke(time, null);
internal void OnRestart() => RestartEvent?.Invoke(null, null);
public void Restart() { RestartEvent?.Invoke(); }