質問編集履歴

1

プレハブ生成時の処理を追記

2019/06/22 12:27

投稿

Qoo
Qoo

スコア1249

test CHANGED
File without changes
test CHANGED
@@ -62,4 +62,80 @@
62
62
 
63
63
  }
64
64
 
65
+
66
+
67
+ void LoadCSV()
68
+
69
+ {
70
+
71
+
72
+
73
+ TextAsset csv = Resources.Load(filePass) as TextAsset;
74
+
75
+ StringReader reader = new StringReader(csv.text);
76
+
77
+
78
+
79
+ int i = 0;
80
+
81
+ while (reader.Peek() > -1)
82
+
83
+ {
84
+
85
+
86
+
87
+ string line = reader.ReadLine();
88
+
89
+ string[] values = line.Split(',');
90
+
91
+ for (int j = 0; j < values.Length; j++)
92
+
93
+ {
94
+
95
+ _timing[i] = float.Parse(values[0]);
96
+
97
+ _lineNum[i] = int.Parse(values[1]);
98
+
99
+ }
100
+
101
+ i++;
102
+
103
+ }
104
+
105
+ }
106
+
107
+
108
+
109
+ private void Update()
110
+
111
+ {
112
+
113
+ CheckNextNotes();
114
+
115
+ }
116
+
117
+
118
+
119
+
120
+
121
+ void CheckNextNotes()
122
+
123
+ {
124
+
125
+ while (_timing[_notesCount] + timeOffset < GetMusicTime() && _timing[_notesCount] != 0)
126
+
127
+ {
128
+
129
+ //ブレハブ生成
130
+
131
+ SpawnNotes(_lineNum[_notesCount]);
132
+
133
+ _notesCount++;
134
+
135
+ }
136
+
137
+ }
138
+
139
+
140
+
65
141
  ```