// Start is called before the first frame update void Start() { specialSpawned = false; hasSpawned = false; setSpawn = false; spawnCode = 0; templates = FindObjectOfType <RoomTemplates>(); if (GetComponentInParent <AddRoom>().getIsDeadend()) { if (!templates.getBossSpawned()) { layoutList = generateBossLayoutList(); templates.setBossSpawned(true); specialSpawned = true; Debug.Log("Boss room should spawn"); } else if (!templates.getShopSpawned()) { layoutList = generateShopLayoutList(); templates.setShopSpawned(true); specialSpawned = true; Debug.Log("Shop room should spawn"); } else if (!templates.getItemSpawned()) { layoutList = generateItemLayoutList(); templates.setItemSpawned(true); specialSpawned = true; Debug.Log("Item room should spawn"); } else { layoutList = generateLayoutList(); } } else { layoutList = generateLayoutList(); } //parent = this.transform.parent.gameObject; //layoutList = generateLayoutList(); chosenLayout = selectLayout(); var newLayout = Instantiate(chosenLayout, this.transform.position, this.transform.rotation); newLayout.transform.SetParent(this.transform); }