using UnityEngine;

public class StartGameButton : MonoBehaviour
{

  public GameManager gameManager;

  // Start is called once before the first execution of Update after the MonoBehaviour is created
  void Start()
  {
    if (gameManager == null)
    {
      gameManager = FindFirstObjectByType<GameManager>();
    }
  }

  private void OnTriggerEnter(Collider other)
  {
    Destroy(other.gameObject);
    if (gameManager != null)
    {
      gameManager.StartGame();
    }
  }

}
