質問編集履歴
1
下にチャレンジ1と2で試したコードです。両方赤の波線がつきました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -28,4 +28,29 @@
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
|
31
|
+
```
|
32
|
+
チャレンジ1
|
33
|
+
```
|
34
|
+
public bool IsAnswerCorrect()
|
35
|
+
{
|
36
|
+
Bottun answer = targetObject1.GetComponent<Bottun>();
|
37
|
+
QuestionManager Qm = targetObject2.GetComponent<QuestionManager>();
|
38
|
+
var answer1 = answer.GetSuujiText();
|
39
|
+
var answer2 = Qm.GetCurrentQuestionData().GetAnswer();
|
40
|
+
answer1.Equals(answer2)
|
41
|
+
return Debug.Log(answer2);
|
42
|
+
}
|
43
|
+
```
|
44
|
+
チャレンジ2
|
45
|
+
```
|
46
|
+
public bool IsAnswerCorrect()
|
47
|
+
{
|
48
|
+
Bottun answer = targetObject1.GetComponent<Bottun>();
|
49
|
+
QuestionManager Qm = targetObject2.GetComponent<QuestionManager>();
|
50
|
+
var answer1 = answer.GetSuujiText();
|
51
|
+
var answer2 = Qm.GetCurrentQuestionData().GetAnswer();
|
52
|
+
Debug.Log(answer2);
|
53
|
+
return answer1.Equals(answer2);
|
54
|
+
}
|
55
|
+
コード
|
31
56
|
```
|