Esempio n. 1
0
	public void CreateNotes(){
		nowmusic = AudioManager.Instance.getNowBGMName();
		AutoNotes = new AutoNotes();
		outjson = AutoNotes.getDataJson(nowmusic);
		//BPM
		BPM = outjson.getBPM();
		//Note数を取り込む
		NotesSum = outjson.getNotesSum();
		newnotes = AutoNotes.getNotesJson(nowmusic);
		//Debug.Log("Sumnotes:"+NotesSum);
		//Note数を元に配列を初期化
		notes = new List<Note>(NotesSum);
		noteobjects = new List<GameObject>(NotesSum);
		Timetable = new List<float>(NotesSum);
		//ファイルからノーツ情報を読み込む処理
		for(int j=0; j<NotesSum; j++){
			//Debug.Log("readNotes:"+ j);
			noteobject = GameObject.Instantiate(Resources.Load("Prefabs/Sphere", typeof(GameObject))) as GameObject;
			rotation = noteobject.GetComponent<Note_Rotation>();
			note = noteobject.GetComponent<Note>();
			note.posx = newnotes[j].posx;
			note.posy = newnotes[j].posy;
			note.posz = newnotes[j].posz;
			note.angle = newnotes[j].angle;
			note.scale = newnotes[j].scale;
			note.radiusBefore = newnotes[j].radiusBefore;
			note.DecisionTime = newnotes[j].DecisionTime;
			note.EmitTime = newnotes[j].EmitTime;
			note.RadiusIncrement = newnotes[j].RadiusIncrement;
			note.TargetName = newnotes[j].TargetName;
			//Debug.Log(note.EmitTime);
			note.Init(noteobject);
			note.Hidden();
			Timetable.Add(note.EmitTime);
			notes.Add(note);
			noteobjects.Add(noteobject);
			//Debug.Log(notes.Count);
		}
		//Debug.Log(notes.Count);
		//this.NoteDestroy(noteobject);
	}