|
@ -20,7 +20,7 @@ public class MonoSingleton : MonoBehaviour where T : MonoSingleton |
|
|
private void SetAsSingleton() |
|
|
private void SetAsSingleton() |
|
|
{ |
|
|
{ |
|
|
if (Instance != null && Instance != this) |
|
|
if (Instance != null && Instance != this) |
|
|
Destroy(this.gameObject); |
|
|
|
|
|
|
|
|
Destroy(this); |
|
|
else |
|
|
else |
|
|
Instance = (T)this; |
|
|
Instance = (T)this; |
|
|
|
|
|
|
|
|