Add level selection system. Add levels upto jester
This commit is contained in:
@@ -8,14 +8,24 @@ namespace Utils
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
if (dontDestroyOnLoad() && Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
Instance = this as T;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
if (dontDestroyOnLoad())
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected virtual bool dontDestroyOnLoad()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user