private void OnDestroy() { if (current == this) { current = null; } }
private void Awake() { if (current && current != this) { Debug.LogError("PCG Main have to be singleton!"); DestroyImmediate(gameObject); } current = this; }