private void Awake()
{
if (!_created && allowSingleton) {
DontDestroyOnLoad(this);
instance = this;
_created = true;
Setup();
} else {
if (allowSingleton) {
if (EventManager.instance.allowWarningOutputs) {
Debug.LogWarning("Only a single instance of " + this.name + " should exists!");
}
Destroy(gameObject);
} else {
instance = this;
Setup();
}
}
}