[Player][Interactions] Pulver moves to item and goes back. Item disappears, but in wrong order
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user