private void OnEnable() { sound = GetComponent <Sound2>(); collider = GetComponent <BoxCollider>(); grid = GetComponentInParent <AudioGrid>(); int i; for (i = 0; i < all.Count && !(all[i].layer > layer); i++) { } all.Insert(i, this); }
private void OnEnable() { instance = this; }