teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

プログラム修正

2020/02/24 12:38

投稿

KS-_-SK
KS-_-SK

スコア39

title CHANGED
File without changes
body CHANGED
@@ -23,7 +23,7 @@
23
23
  int RN = 0;//正解数管理
24
24
  public int FN = 10;//メモ帳の行数管理
25
25
  int US;//値を一時保存する変数
26
- public string US1,US2;//問題を一時保存する変数
26
+ public Text US1,US2;//問題を一時保存する変数
27
27
 
28
28
  // Start is called before the first frame update
29
29
  void Start()
@@ -31,8 +31,8 @@
31
31
  //コンポーネントを扱えるようにする
32
32
  i_p = i_p.GetComponent<InputField>();
33
33
  t_x = t_x.GetComponent<Text>();
34
- /*US1 = US1.GetComponent<Text>();
34
+ US1 = US1.GetComponent<Text>();
35
- US2 = US2.GetComponent<Text>();*/
35
+ US2 = US2.GetComponent<Text>();
36
36
  //seikaisuu = seikaisuu.GetComponent<Seikaisuu>();
37
37
  //t_t = t_t.GetComponent<t_t>();
38
38
  NS();
@@ -62,8 +62,8 @@
62
62
  }
63
63
  while (hantei == false)
64
64
  {
65
- File.ReadLines(@"C:\Users\sk\Desktop\g2_b.txt");
65
+ File.ReadLines(@"C:\Users\プログラミング\Desktop\g2_b.txt");
66
- File.ReadLines(@"C:\Users\sk\Desktop\g2_ba.txt");
66
+ File.ReadLines(@"C:\Users\プログラミング\Desktop\g2_ba.txt");
67
67
  QN--;
68
68
  Debug.Log(QN);
69
69
 
@@ -74,9 +74,9 @@
74
74
  File.AppendAllText(@"C:\Users\sk\Desktop\g2_ba.txt", "");
75
75
  }
76
76
  //***************
77
- US1 = /*File.AppendText*/(@"C:\Users\sk\Desktop\g2_b.txt");
77
+ US1.text = (@"C:\Users\sk\Desktop\g2_b.txt");
78
- US2 = /*File.AppendText*/(@"C:\Users\sk\Desktop\g2_ba.txt");
78
+ US2.text = (@"C:\Users\sk\Desktop\g2_ba.txt");
79
- t_x.text = "どういう意味?:" + US1;
79
+ t_x.text = "どういう意味?:" + US1.text;
80
80
  }
81
81
 
82
82
 
@@ -85,9 +85,9 @@
85
85
 
86
86
  public void IT()
87
87
  {
88
- K_O.text = "正しい答え:" + US2;
88
+ K_O.text = "正しい答え:" + US2.text;
89
89
  //解答が模範解答と同じだった時の処理
90
- if (US2 == i_p.text)
90
+ if (US2.text == i_p.text)
91
91
  {
92
92
  RN++;
93
93
  Debug.Log("できた");
@@ -138,4 +138,8 @@
138
138
  //テキストにi_pの内容を反映
139
139
  //t_x.text = i_p.text;
140
140
  ```
141
- もっと詳しい情報が必要でしたら、お知らせください。情報量が少なくて、すみません。
141
+ もっと詳しい情報が必要でしたら、お知らせください。情報量が少なくて、すみません。
142
+ ###確認したこと
143
+ ・アタッチされている
144
+ ・実行様子:
145
+ ![イメージ説明](b64b7f7c18d52b0d4ede976263801595.gif)