Ejemplo n.º 1
0
    public void AttemptToSpawnObject(GameObject room, Transform spawnTransform)
    {
        SpawnableObject spawmedObjectPrefab = SpawnableObject.ChooseRandomSpawnable(SpawnableObjects);

        if (spawmedObjectPrefab == null || spawmedObjectPrefab.spawnableObject == null || !spawnTransform)
        {
            return;
        }

        GameObject newSpawnable = Instantiate(spawmedObjectPrefab.spawnableObject, spawnTransform.position, spawnTransform.rotation);

        newSpawnable.transform.SetParent(room.transform);
    }