[Player][Interactions] Pulver moves to item and goes back. Item disappears, but in wrong order

This commit is contained in:
Michal Pikulski
2025-09-04 00:00:46 +02:00
parent 97c5edf619
commit 0c930d09a4
18 changed files with 455 additions and 43 deletions

View File

@@ -6,7 +6,24 @@ using UnityEngine.SceneManagement;
public class SceneManagerService : MonoBehaviour
{
public static SceneManagerService Instance { get; private set; }
private static SceneManagerService _instance;
public static SceneManagerService Instance
{
get
{
if (_instance == null)
{
_instance = FindAnyObjectByType<SceneManagerService>();
if (_instance == null)
{
var go = new GameObject("SceneManagerService");
_instance = go.AddComponent<SceneManagerService>();
DontDestroyOnLoad(go);
}
}
return _instance;
}
}
// Events for scene lifecycle
public event Action<string> SceneLoadStarted;
@@ -21,12 +38,7 @@ public class SceneManagerService : MonoBehaviour
void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
_instance = this;
DontDestroyOnLoad(gameObject);
}