2025-10-03 02:18:28 +08:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class LoadRoomManager : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[Tooltip("Default Dungeon SO")] public DungeonHomeSO dungeonHomeSo;
|
|
|
|
|
[Tooltip("BugStatus Room")] public GameObject roomBugStatue;
|
|
|
|
|
[Tooltip("Center Position")] public GameObject startPositionObject;
|
|
|
|
|
|
|
|
|
|
private void create_room(GameObject room_prefab, Vector3 m_create_position)
|
|
|
|
|
{
|
|
|
|
|
GameObject room = Instantiate(room_prefab, m_create_position, Quaternion.identity);
|
|
|
|
|
room.name = $"room_{room.transform.position}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
foreach (DungeonDataclass item in dungeonHomeSo.return_all_data())
|
|
|
|
|
{
|
|
|
|
|
if (item.roomType == RoomType.BugStatueRoom)
|
|
|
|
|
{
|
|
|
|
|
// create_room(controllerRoomPrefab, new Vector3(item.positionX * 1f, item.positionY * 1f, 0));
|
|
|
|
|
create_room(roomBugStatue,
|
2025-10-08 16:31:53 +08:00
|
|
|
startPositionObject.transform.position + new Vector3(item.position.x * item.roomSize,
|
|
|
|
|
-item.position.y * item.roomSize, 0));
|
2025-10-03 02:18:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|