UNITYで音げーを作っています。
AwakeでCSVデータを読みこみプレハブオブジェクトを生成し、
音楽終了とともにシーンをリロードしているのですが、
リロード後、音楽は再生されますが、プレハブオブジェクトが生成されません。
リロード時に何か引き継がれるようなものはあるのでしょうか?
特にStaticなどの変数も利用していません。
完全にリロードするにはどうすればよいでしょうか?
private void Awake() { LoadCSV(); } void Start() { StartCoroutine(StartMusic()); } IEnumerator StartMusic() { yield return new WaitForSeconds(MusicDelayTime); _audioSource.Play(); StartCoroutine(Checking(() => { //終了 Debug.Log("MusicEND!"); SceneManager.LoadScene(SceneManager.GetActiveScene().name); })); } void LoadCSV() { TextAsset csv = Resources.Load(filePass) as TextAsset; StringReader reader = new StringReader(csv.text); int i = 0; while (reader.Peek() > -1) { string line = reader.ReadLine(); string[] values = line.Split(','); for (int j = 0; j < values.Length; j++) { _timing[i] = float.Parse(values[0]); _lineNum[i] = int.Parse(values[1]); } i++; } } private void Update() { CheckNextNotes(); } void CheckNextNotes() { while (_timing[_notesCount] + timeOffset < GetMusicTime() && _timing[_notesCount] != 0) { //ブレハブ生成 SpawnNotes(_lineNum[_notesCount]); _notesCount++; } }

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。