質問編集履歴

1

2022/02/16 06:59

投稿

NI_
NI_

スコア9

test CHANGED
File without changes
test CHANGED
@@ -19,8 +19,8 @@
19
19
  ```
20
20
  IndexOutOfRangeException: Index was outside the bounds of the array.
21
21
  (wrapper stelemref) System.Object.virt_stelemref_class_small_idepth(intptr,object)
22
- Player.Start () (at Assets/Player.cs:60)
22
+ Player.SetDeck () (at Assets/Player.cs:131)
23
-
23
+ Main.Start () (at Assets/Main.cs:22)
24
24
  ```
25
25
 
26
26
 
@@ -156,11 +156,6 @@
156
156
  {
157
157
  for (int i = 0; i < 40; i++)
158
158
  {
159
- Debug.Log(pladeck.deckname);
160
- Debug.Log(pladeck.deckcard[i].cardname);
161
- }
162
- for (int i = 0; i < 40; i++)
163
- {
164
159
  deck[i] = pladeck.deckcard[i];
165
160
  }
166
161
  DeckShuffle();
@@ -280,7 +275,7 @@
280
275
  }
281
276
  }
282
277
 
283
- //Card???GameObject????x???????????????
278
+
284
279
  private void Remove(ref Card[] array1, ref GameObject[] array2, int x)
285
280
  {
286
281
  Destroy(array2[x]);
@@ -299,3 +294,54 @@
299
294
 
300
295
  ```
301
296
 
297
+ ```C#
298
+ using System.Collections;
299
+ using System.Collections.Generic;
300
+ using UnityEngine;
301
+ using UnityEngine.UI;
302
+ using System;
303
+ using System.Linq;
304
+ using System.Security.Cryptography;
305
+
306
+
307
+ public class Main : MonoBehaviour
308
+ {
309
+ void Start()
310
+ {
311
+ GameObject PlayerObj1 = GameObject.Find("Player1");
312
+ Player player1 = PlayerObj1.GetComponent<Player>();
313
+
314
+ GameObject PlayerObj2 = GameObject.Find("Player2");
315
+ Player player2 = PlayerObj1.GetComponent<Player>();
316
+
317
+
318
+
319
+ player1.SetDeck(); //デッキを設置
320
+ player2.SetDeck();
321
+
322
+
323
+ for (int i = 0; i < 5; i++) player1.DeckToShield();
324
+ for (int i = 0; i < 5; i++) player2.DeckToShield();
325
+
326
+ for (int i = 0; i < 5; i++) player1.Draw();
327
+ for (int i = 0; i < 5; i++) player2.Draw();
328
+
329
+ if (player1.Ask_YesOrNo("マナチャージしますか?"))
330
+ {
331
+ Debug.Log("Yesが選ばれた");
332
+ player1.FillinMana();
333
+ }
334
+ else Debug.Log("Noが選ばれた");
335
+ }
336
+
337
+
338
+ void Update()
339
+ {
340
+
341
+ }
342
+
343
+
344
+ }
345
+
346
+ ```
347
+