質問編集履歴
2
コードを見やすくしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
//ランダムな文字列を作成
|
4
4
|
|
5
|
-
private const string
|
5
|
+
private const string CHARS = "0123456789abcdefghijklmnopqrstuvwxyz";
|
6
6
|
|
7
7
|
public static string GenerateRandomNumber(int length)
|
8
8
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
int pos = r.Next(VillagerID_CHARS.Length);
|
26
26
|
|
27
|
-
char c =
|
27
|
+
char c = CHARS[pos];
|
28
28
|
|
29
29
|
sb.Append(c);
|
30
30
|
|
1
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
private const string VillagerID_CHARS = "0123456789abcdefghijklmnopqrstuvwxyz";
|
6
6
|
|
7
|
-
public static string Generate
|
7
|
+
public static string GenerateRandomNumber(int length)
|
8
8
|
|
9
9
|
{
|
10
10
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
|
61
61
|
{
|
62
62
|
|
63
|
-
str[i] = Generate
|
63
|
+
str[i] = GenerateRandomNumber(5);
|
64
64
|
|
65
65
|
Debug.Log(str[i]);
|
66
66
|
|