private void Awake() { if (!current) { current = this; DontDestroyOnLoad(gameObject); } else if (current != this) { Destroy(gameObject); } }
private void OnDestroy() { current = null; }