Fixed rooms not loading as prefabs
This commit is contained in:
parent
438d3a9a79
commit
0ade17a3c8
3 changed files with 10737 additions and 85695 deletions
|
|
@ -3091,8 +3091,8 @@ Camera:
|
|||
m_GameObject: {fileID: 2029992415}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.031372372, g: 0.040399473, b: 0.047169805, a: 1}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
|
|
@ -3117,7 +3117,7 @@ Camera:
|
|||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
orthographic size: 7.35
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using DungeonMapGenerator;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEditor;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
|
||||
|
|
@ -25,39 +26,28 @@ namespace DungeonGenerator
|
|||
GameObject monsterRoomPrefab = Resources.Load<GameObject>(MONSTER_ROOM);
|
||||
GameObject normalRoomPrefab = Resources.Load<GameObject>(NORMAL_ROOM);
|
||||
|
||||
GameObject bossRoomGO = Object.Instantiate(bossRoomPrefab,
|
||||
ConvertToUnityPosition(map.GetBossRoom().GetCenterOfRoom(), map.Width, map.Height),
|
||||
Quaternion.identity,
|
||||
gameObject.transform);
|
||||
GameObject bossRoomGO = PrefabUtility.InstantiatePrefab(bossRoomPrefab, gameObject.transform) as GameObject;
|
||||
bossRoomGO.transform.position = ConvertToUnityPosition(map.GetBossRoom().GetCenterOfRoom(), map.Width, map.Height);
|
||||
_roomIdToGameObject[map.GetBossRoom().Id] = bossRoomGO;
|
||||
|
||||
foreach (var monsterRoom in map.GetMonsterRooms())
|
||||
{
|
||||
GameObject monsterRoomGO = Object.Instantiate(
|
||||
monsterRoomPrefab,
|
||||
ConvertToUnityPosition(monsterRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||
Quaternion.identity,
|
||||
gameObject.transform);
|
||||
GameObject monsterRoomGO = PrefabUtility.InstantiatePrefab(monsterRoomPrefab, gameObject.transform) as GameObject;
|
||||
monsterRoomGO.transform.position = ConvertToUnityPosition(monsterRoom.GetCenterOfRoom(), map.Width, map.Height);
|
||||
_roomIdToGameObject[monsterRoom.Id] = monsterRoomGO;
|
||||
}
|
||||
|
||||
foreach (var normalRoom in map.GetNormalRooms())
|
||||
{
|
||||
GameObject normalRoomGO = Object.Instantiate(
|
||||
normalRoomPrefab,
|
||||
ConvertToUnityPosition(normalRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||
Quaternion.identity,
|
||||
gameObject.transform);
|
||||
GameObject normalRoomGO = PrefabUtility.InstantiatePrefab(normalRoomPrefab, gameObject.transform) as GameObject;
|
||||
normalRoomGO.transform.position = ConvertToUnityPosition(normalRoom.GetCenterOfRoom(), map.Width, map.Height);
|
||||
_roomIdToGameObject[normalRoom.Id] = normalRoomGO;
|
||||
}
|
||||
|
||||
foreach (var entranceRoom in map.GetEntranceRooms())
|
||||
{
|
||||
GameObject entranceRoomGO = Object.Instantiate(
|
||||
normalRoomPrefab,
|
||||
ConvertToUnityPosition(entranceRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||
Quaternion.identity,
|
||||
gameObject.transform);
|
||||
GameObject entranceRoomGO = PrefabUtility.InstantiatePrefab(normalRoomPrefab, gameObject.transform) as GameObject;
|
||||
entranceRoomGO.transform.position = ConvertToUnityPosition(entranceRoom.GetCenterOfRoom(), map.Width, map.Height);
|
||||
entranceRoomGO.GetComponent<Room>().IsEntrance = true;
|
||||
_roomIdToGameObject[entranceRoom.Id] = entranceRoomGO;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue