質問編集履歴

1

引数の説明 coroutineの起きない場所にマーク

2019/12/08 05:16

投稿

harupattyo
harupattyo

スコア4

test CHANGED
File without changes
test CHANGED
@@ -18,10 +18,54 @@
18
18
 
19
19
  ### 該当のソースコード
20
20
 
21
-
22
-
23
21
  ```c#
24
22
 
23
+ Message.text = "敵のターンだ!";
24
+
25
+ yield return new WaitUntil(() => Input.GetButtonDown("Submit"));
26
+
27
+ /*Message.text=*/Debug.Log( list[turn].name + "の攻撃!");
28
+
29
+
30
+
31
+ yield return new WaitUntil(() => Input.GetButtonDown("Submit"));// <=起きない
32
+
33
+ audioSource.PlayOneShot(sound[1]);
34
+
35
+ PLstatus.hp = PLstatus.hp - list[turn].attack;
36
+
37
+ if (PLstatus.hp <= 0)
38
+
39
+ {
40
+
41
+ PLstatus.hp = 0;
42
+
43
+ }
44
+
45
+ HPchange();
46
+
47
+ Debug.Log("ターン" + turn);
48
+
49
+ Debug.Log(list[turn].name);
50
+
51
+ Message.text = PLstatus.Playername + "は" + list[turn].attack + "のダメージを受けた!";
52
+
53
+ yield return new WaitUntil(() => Input.GetButtonDown("Submit"));
54
+
55
+ IsRunning = false;
56
+
57
+ turn2 = true;
58
+
59
+ Debug.Log("敵オワタン");
60
+
61
+ Debug.Log("turn2" + turn2);
62
+
63
+ turnjudge();
64
+
65
+ ```
66
+
67
+ ```c#
68
+
25
69
  IEnumerator PlayerAttackTurn()
26
70
 
27
71
  {
@@ -76,10 +120,68 @@
76
120
 
77
121
  Monster[trigger.SelectMonster].hp = Monster[trigger.SelectMonster].hp - skill.skill[0].value;
78
122
 
79
- Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[0].value + "与えた!";
123
+ Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[0].value + "与えた!";
124
+
125
+ yield return new WaitUntil(() => Input.GetButtonDown("Submit"));// <=ここが起きない
126
+
127
+ IsPlayerTurn = false;
128
+
129
+ IsRunning = false;
130
+
131
+ turn2 = true;
132
+
133
+ trigger.Judge = false;
134
+
135
+ trigger.Judge2 = false;
136
+
137
+ turnjudge();
138
+
139
+ break;
140
+
141
+ case 2:
142
+
143
+ AllMenue.interactable = false;
144
+
145
+ AllMenue.alpha = 0;
146
+
147
+ At.interactable = false;
148
+
149
+ EventSystem.current.SetSelectedGameObject(AttackButton);
150
+
151
+ Monster[trigger.SelectMonster].hp = Monster[trigger.SelectMonster].hp - skill.skill[1].value;
152
+
153
+ Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[1].value + "与えた!";// <=ここが起きない
154
+
155
+ IsPlayerTurn = false;
156
+
157
+ IsRunning = false;
158
+
159
+ turn2 = true;
160
+
161
+ trigger.Judge = false;
162
+
163
+ trigger.Judge2 = false;
164
+
165
+ turnjudge();
80
166
 
81
167
  yield return new WaitUntil(() => Input.GetButtonDown("Submit"));
82
168
 
169
+ break;
170
+
171
+ case 3:
172
+
173
+ AllMenue.interactable = false;
174
+
175
+ AllMenue.alpha = 0;
176
+
177
+ At.interactable = false;
178
+
179
+ EventSystem.current.SetSelectedGameObject(AttackButton);
180
+
181
+ Monster[trigger.SelectMonster].hp = Monster[trigger.SelectMonster].hp - skill.skill[2].value;
182
+
183
+ Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[2].value + "与えた!";
184
+
83
185
  IsPlayerTurn = false;
84
186
 
85
187
  IsRunning = false;
@@ -92,68 +194,10 @@
92
194
 
93
195
  turnjudge();
94
196
 
197
+ yield return new WaitUntil(() => Input.GetButtonDown("Submit"));// <=ここが起きない
198
+
95
199
  break;
96
200
 
97
- case 2:
98
-
99
- AllMenue.interactable = false;
100
-
101
- AllMenue.alpha = 0;
102
-
103
- At.interactable = false;
104
-
105
- EventSystem.current.SetSelectedGameObject(AttackButton);
106
-
107
- Monster[trigger.SelectMonster].hp = Monster[trigger.SelectMonster].hp - skill.skill[1].value;
108
-
109
- Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[1].value + "与えた!";
110
-
111
- IsPlayerTurn = false;
112
-
113
- IsRunning = false;
114
-
115
- turn2 = true;
116
-
117
- trigger.Judge = false;
118
-
119
- trigger.Judge2 = false;
120
-
121
- turnjudge();
122
-
123
- yield return new WaitUntil(() => Input.GetButtonDown("Submit"));
124
-
125
- break;
126
-
127
- case 3:
128
-
129
- AllMenue.interactable = false;
130
-
131
- AllMenue.alpha = 0;
132
-
133
- At.interactable = false;
134
-
135
- EventSystem.current.SetSelectedGameObject(AttackButton);
136
-
137
- Monster[trigger.SelectMonster].hp = Monster[trigger.SelectMonster].hp - skill.skill[2].value;
138
-
139
- Message.text = Monster[trigger.SelectMonster].name + "に" + skill.skill[2].value + "与えた!";
140
-
141
- IsPlayerTurn = false;
142
-
143
- IsRunning = false;
144
-
145
- turn2 = true;
146
-
147
- trigger.Judge = false;
148
-
149
- trigger.Judge2 = false;
150
-
151
- turnjudge();
152
-
153
- yield return new WaitUntil(() => Input.GetButtonDown("Submit"));
154
-
155
- break;
156
-
157
201
  }
158
202
 
159
203
 
@@ -218,6 +262,56 @@
218
262
 
219
263
  ### 補足情報(FW/ツールのバージョンなど)
220
264
 
221
-
265
+ スクリプト内の起きない場所にマークしました。
266
+
267
+ trigger.numberの引数
268
+
269
+ ```c#
270
+
271
+ public void Skill1()
272
+
273
+ {
274
+
275
+ number = 1;
276
+
277
+ }
278
+
279
+ public void Skill2()
280
+
281
+ {
282
+
283
+ number = 2;
284
+
285
+ }
286
+
287
+ public void Skill3()
288
+
289
+ {
290
+
291
+ number = 3;
292
+
293
+ }
294
+
295
+ public void MonsterSel1()
296
+
297
+ {
298
+
299
+ Judge = true;
300
+
301
+ SelectMonster = 0;
302
+
303
+ }
304
+
305
+ public void MonsterSel2()
306
+
307
+ {
308
+
309
+ Judge2 = true;
310
+
311
+ SelectMonster = 1;
312
+
313
+ }
314
+
315
+ ```
222
316
 
223
317
  初心者なゆえ汚いプログラムお許しください。