public IEnumerator Generator() { gb.GenerateNote(); Vector3 pos = new Vector3(0, -0.5f, 0); int handID = gb.noteID; int modeDir = gb.noteAngle; GameObject note; switch (handID) { case 1: note = Instantiate(s1, pos, transform.rotation); break; case 2: note = Instantiate(s2, pos, transform.rotation); break; case 3: note = Instantiate(s3, pos, transform.rotation); break; case 4: note = Instantiate(s4, pos, transform.rotation); break; default: note = Instantiate(s0, pos, transform.rotation); break; } note.AddComponent(typeof(StarMove)); StarMove spt = (StarMove)note.GetComponent(typeof(StarMove)); spt.ChangeMode(modeDir, handID, exp[handID - 1]); yield return(null); }