void CheckTouchableNote() { PlayNoteInfo pni = livePlayNotes.GetPlayableNoteInfo(musicManager.GetPlayTime()); if (pni != null && pni.effectIndex < 4) { musicManager.PlayEffectSound(pni.effectIndex); pni.prePlayed = true; touchableNotes[pni.effectIndex].Add(pni); } }
public void Load(string filename) { Clear(); TextAsset textAsset = (TextAsset)Resources.Load("Stages/" + filename, typeof(TextAsset)); JsonData json = JsonMapper.ToObject(textAsset.text); JsonData jsonSoundName = json ["soundname"]; soundName = jsonSoundName.ToString(); JsonData jsonBpm = json ["bpm"]; string strBpm = jsonBpm.ToJson(); bpm = (float)Convert.ToDouble(strBpm); JsonData jsonCloneNoteMoveCount = json ["clonenotemovecount"]; string strCloneNoteMoveCount = jsonCloneNoteMoveCount.ToJson(); cloneNoteMoveCount = Convert.ToInt32(strCloneNoteMoveCount); JsonData jsonNoteCounts = json ["notecount"]; string strNoteCounts = jsonNoteCounts.ToJson(); noteCounts = Convert.ToInt32(strNoteCounts); JsonData jsonNotes = json["notes"]; for (int i = 0; i < jsonNotes.Count; i++) { JsonData jsonNote = jsonNotes[i]; PlayNoteInfo playNoteInfo = new PlayNoteInfo(); string strTime = jsonNote["time"].ToJson(); playNoteInfo.playTime = (float)Convert.ToDouble(strTime); string strEffectIndex = jsonNote["effectindex"].ToJson(); playNoteInfo.effectIndex = Convert.ToInt32(strEffectIndex); string strGroupIndex = jsonNote["groupindex"].ToJson(); playNoteInfo.groupIndex = Convert.ToInt32(strGroupIndex); string strCloned = jsonNote["cloned"].ToJson(); playNoteInfo.cloned = Convert.ToBoolean(strCloned); // if(playNoteInfo.effectIndex == (int)LineType.LT_LineDivide) // { // divideNoteList.Add (playNoteInfo); // } // else if(playNoteInfo.effectIndex == (int)LineType.LT_LineCutin) // { // cutinNoteList.Add (playNoteInfo); // } // else // { playableNoteList.Add(playNoteInfo); // } } }