using UnityEngine; public class startTrigger : MonoBehaviour { private tetrominoSpawnManager TetrominoSpawnManager; private bool gameStarted; // Start is called before the first frame update void Start() { TetrominoSpawnManager = FindObjectOfType(); } private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player" && !gameStarted) { GetComponent().Play(); TetrominoSpawnManager.spawnTetromino(); gameStarted = true; gameObject.SetActive(false); } } }