void OnDestroy() { if (current == this) { Reset(); current = null; } }
void Awake() { if (current != null) { Debug.LogError("Only 1x Parallax2D script may be active at a time. Delete the current Parallax2D script before creating a new one. Aborting."); Destroy(gameObject); return; } current = this; }