Exemple #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        other.CheckArgument();

        if (other.CompareTag("SpawnPoint"))
        {
            if (other.GetComponent <RoomSpawner>().spawned == false && spawned == false)
            {
                Instantiate(templates.closedRoom, transform.position, Quaternion.identity);
                Destroy(gameObject);
            }
            spawned = true;
        }
    }