ソースコード
C#
1 int x = 0; 2 float[] degrees = new float[count]; 3 Debug.Log(tCR_rate); 4 for(int i = 0; i < count; i++) 5 { 6 if(i < tCR_rate) 7 { 8 degrees[i] = i / tCR_rate; 9 Debug.Log(degrees[i] + "前半"); 10 } 11 else if (i > count - tCR_rate) 12 { 13 degrees[i] = 1 - x / tCR_rate; 14 Debug.Log(degrees[i] + "後半"); 15 x++; 16 } 17 else 18 { 19 degrees[i] = 1; 20 Debug.Log(degrees[i]); 21 } 22 } 23 Debug.Log("end");
発生している問題
必要な部分だけ切り抜いていますが、画像ではcountは500、tCR_rateは125です。
0, 0.1, 0.2, 0.3,.....1, 1, 1, 1,.......0.3, 0.2, 0.1, 0のような配列(countが30で tCR_rateが10の場合)を作りたいのですが、
上記のコードで、以下の出力になります。
何が問題なのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/02/27 23:54
2022/02/28 06:54