Example #1
0
    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;
    }
Example #2
0
 internal void OnRestart(int time = 5) => RestartEvent?.Invoke(time, null);
Example #3
0
 internal void OnRestart() => RestartEvent?.Invoke(null, null);
Example #4
0
 public void Restart()
 {
     RestartEvent?.Invoke();
 }