private void Awake() { if (singleton != null) { Destroy(gameObject); return; } singleton = this; wormyCamera = Camera.main.transform; }
void Start() { if (singleton != null) { Destroy(gameObject); return; } singleton = this; wormies = GameObject.FindObjectsOfType <Wormy>(); wormyCamera = Camera.main.transform; for (int i = 0; i < wormies.Length; i++) { wormies[i].wormId = i; } }