void OnDestroy() { if (instance == this) { instance = null; } }
void Awake() { //Disable macots for (int i = 0; i < mascots.Count; ++i) { mascots[i].gameObject.SetActive(false); } for (int i = 0; i < randomPositions.Count; ++i) { randomPositions[i].gameObject.SetActive(false); } if (instance == null) { instance = this; } else { DestroyImmediate(this.gameObject); } }