private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void Start() { beat = GameObject.FindWithTag("Player").GetComponent <BeatStrike>(); lightTest = new Light[lightName.Length][]; lightSet = new GameObject[lightName.Length][]; for (int i = 0; i < lightName.Length; i++) { lightSet[i] = GameObject.FindGameObjectsWithTag(lightName[i]); lightTest[i] = new Light[lightSet[i].Length]; for (int j = 0; j < lightSet[i].Length; j++) { lightTest[i][j] = lightSet[i][j].GetComponent <Light>(); } } lightNumber = lightName.Length; count = 0; }