// Function to open door public void OpenDoor() isDoorOpened = true;

public class DoorScript : MonoBehaviour

This script is designed to simplify the process of spawning entities or skipping rooms when a door is opened. It allows you to easily configure doors to trigger specific actions, such as spawning enemies, items, or other entities, or skipping rooms to create a more dynamic and immersive gameplay experience.

// Flag to check if door is opened private bool isDoorOpened = false;

// Function to spawn entity void SpawnEntity() // Instantiate entity at door position Instantiate(entityToSpawn, transform.position, Quaternion.identity);

// Entity to spawn when door is opened public GameObject entityToSpawn;