Add utils + refacto
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user