// computer play the notes void ComPlay(int pitch, float volumn) { comAnimeControl.Sing(); com.Stop(); print(pitch); com.clip = piano[pitch]; com.volume = volumn; com.Play(); }
// Update is called once per frame void Update() { if (state == 1 & Input.GetKeyDown("f")) { float hitStamp = Time.realtimeSinceStartup; if (hitStamp - noteStamp < tolerence) { PlayerPlay(iPlayer, jPlayer); state = 2; animecontrol.Sing(); correct++; } else { print("wrong" + (hitStamp - noteStamp).ToString()); EffectPlay(0); animecontrol.Fail(); state = 2; wrong++; } } }