Add utils + refacto

This commit is contained in:
2026-01-30 17:39:26 +01:00
parent 9ff17b5305
commit 23d3cb5d2c
29 changed files with 675 additions and 461 deletions
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using UnityEngine;
using Unheimlich.Core;
using Unheimlich.Gameplay.Portals;
namespace Unheimlich.Managers
@@ -9,9 +10,8 @@ namespace Unheimlich.Managers
/// Monitors player distance to portals and loads/unloads room instances accordingly.
/// Supports room pooling (keeping inactive rooms in memory) and distance-based activation.
/// </summary>
public class PortalRoomManager : MonoBehaviour
public class PortalRoomManager : Singleton<PortalRoomManager>
{
public static PortalRoomManager Instance { get; private set; }
[Header("Settings")]
[SerializeField] private float _loadDistance = 15f;
@@ -44,16 +44,6 @@ namespace Unheimlich.Managers
public bool BoundsCalculated = false;
}
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(this);
return;
}
Instance = this;
}
private void Start()
{
_player = GameObject.FindGameObjectWithTag("Player")?.transform;