gimm-platformer-project/Assets/Scripts/startTrigger.cs

25 lines
583 B
C#
Raw Normal View History

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class startTrigger : MonoBehaviour
{
private tetrominoSpawnManager TetrominoSpawnManager;
// Start is called before the first frame update
void Start()
{
TetrominoSpawnManager = FindObjectOfType<tetrominoSpawnManager>();
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Player")
{
TetrominoSpawnManager.spawnTetromino();
gameObject.SetActive(false);
}
}
}