質問編集履歴
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -240,198 +240,194 @@
|
|
240
240
|
|
241
241
|
}
|
242
242
|
|
243
|
+
|
244
|
+
|
243
|
-
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
|
244
|
-
|
249
|
+
[PunRPC]
|
250
|
+
|
245
|
-
|
251
|
+
private void mondaiStart()
|
252
|
+
|
253
|
+
{
|
254
|
+
|
255
|
+
turn1 = true;
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
[PunRPC]
|
268
|
+
|
269
|
+
private void Ready()
|
270
|
+
|
271
|
+
{
|
272
|
+
|
273
|
+
rivalReady1 = true;
|
274
|
+
|
275
|
+
photonView.RPC("RivalReady1", RpcTarget.MasterClient);
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
[PunRPC]
|
282
|
+
|
283
|
+
private void RivalReady1()
|
284
|
+
|
285
|
+
{
|
286
|
+
|
287
|
+
rivalReady1 = true;
|
288
|
+
|
289
|
+
}
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
```
|
304
|
+
|
305
|
+
プレイヤー側のスクリプト
|
306
|
+
|
307
|
+
```C#
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
public class PlayerManagerOnline : MonoBehaviourPunCallbacks
|
316
|
+
|
317
|
+
{
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
public bool rivalReady = false;
|
322
|
+
|
323
|
+
public bool Ready = false
|
324
|
+
|
325
|
+
private PhotonView photonView;
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
void Start()
|
338
|
+
|
339
|
+
{
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
photonView = GetComponent<PhotonView>();
|
344
|
+
|
345
|
+
}
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
void Update()
|
352
|
+
|
353
|
+
{
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
//どちらも問題をみたときに回答をさせる
|
358
|
+
|
359
|
+
if (enemyManager.rivalReady1)
|
360
|
+
|
361
|
+
{
|
362
|
+
|
363
|
+
if (PhotonNetwork.IsMasterClient)
|
364
|
+
|
365
|
+
{
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
//マスタークライアントに、ボタン表示のメソッドを書き、RPCメソッドでothersに表示
|
370
|
+
|
371
|
+
(countはカウントダウンが起こって同期するように設定がしてあります)
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
if (count < this.delatime)
|
376
|
+
|
377
|
+
{
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
//時間切れの際に発動
|
382
|
+
|
383
|
+
enemyManager.rivalReady1 = false;
|
384
|
+
|
385
|
+
enemyManager.turn2 = true;
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
}
|
390
|
+
|
391
|
+
//リストを先に埋めた方が勝ちになっておりそのメソッドは書いてあります
|
392
|
+
|
393
|
+
else if (stinglist.Count == enemyManager.stinglistAttack.Count)
|
394
|
+
|
395
|
+
{
|
396
|
+
|
397
|
+
enemyManager.rivalReady1 = false
|
398
|
+
|
399
|
+
enemyManager.turn2 = true;
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
}
|
408
|
+
|
409
|
+
//リストを先に埋めた方が勝ちになっておりそのメソッドは書いてあります
|
410
|
+
|
411
|
+
else if (stinglistRival.Count == enemyManager.stinglistAttack.Count)
|
412
|
+
|
413
|
+
{ enemyManager.rivalReady1 = false;
|
414
|
+
|
415
|
+
enemyManager.turn2 = true;
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
}
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
246
426
|
|
247
427
|
|
248
428
|
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
[PunRPC]
|
254
|
-
|
255
|
-
private void mondaiStart()
|
256
|
-
|
257
|
-
{
|
258
|
-
|
259
|
-
turn1 = true;
|
260
|
-
|
261
|
-
}
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
[PunRPC]
|
272
|
-
|
273
|
-
private void Ready()
|
274
|
-
|
275
|
-
{
|
276
|
-
|
277
|
-
rivalReady1 = true;
|
278
|
-
|
279
|
-
photonView.RPC("RivalReady1", RpcTarget.MasterClient);
|
280
|
-
|
281
|
-
}
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
[PunRPC]
|
286
|
-
|
287
|
-
private void RivalReady1()
|
288
|
-
|
289
|
-
{
|
290
|
-
|
291
|
-
rivalReady1 = true;
|
292
|
-
|
293
|
-
}
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
429
|
}
|
302
430
|
|
303
431
|
|
304
432
|
|
305
|
-
|
306
|
-
|
307
433
|
```
|
308
|
-
|
309
|
-
プレイヤー側のスクリプト
|
310
|
-
|
311
|
-
```C#
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
public class PlayerManagerOnline : MonoBehaviourPunCallbacks
|
320
|
-
|
321
|
-
{
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
public bool rivalReady = false;
|
326
|
-
|
327
|
-
public bool Ready = false
|
328
|
-
|
329
|
-
private PhotonView photonView;
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
void Start()
|
342
|
-
|
343
|
-
{
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
photonView = GetComponent<PhotonView>();
|
348
|
-
|
349
|
-
}
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
void Update()
|
356
|
-
|
357
|
-
{
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
//どちらも問題をみたときに回答をさせる
|
362
|
-
|
363
|
-
if (enemyManager.rivalReady1)
|
364
|
-
|
365
|
-
{
|
366
|
-
|
367
|
-
if (PhotonNetwork.IsMasterClient)
|
368
|
-
|
369
|
-
{
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
//マスタークライアントに、ボタン表示のメソッドを書き、RPCメソッドでothersに表示
|
374
|
-
|
375
|
-
(countはカウントダウンが起こって同期するように設定がしてあります)
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
if (count < this.delatime)
|
380
|
-
|
381
|
-
{
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
//時間切れの際に発動
|
386
|
-
|
387
|
-
enemyManager.rivalReady1 = false;
|
388
|
-
|
389
|
-
enemyManager.turn2 = true;
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
}
|
394
|
-
|
395
|
-
//リストを先に埋めた方が勝ちになっておりそのメソッドは書いてあります
|
396
|
-
|
397
|
-
else if (stinglist.Count == enemyManager.stinglistAttack.Count)
|
398
|
-
|
399
|
-
{
|
400
|
-
|
401
|
-
enemyManager.rivalReady1 = false
|
402
|
-
|
403
|
-
enemyManager.turn2 = true;
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
}
|
412
|
-
|
413
|
-
//リストを先に埋めた方が勝ちになっておりそのメソッドは書いてあります
|
414
|
-
|
415
|
-
else if (stinglistRival.Count == enemyManager.stinglistAttack.Count)
|
416
|
-
|
417
|
-
{ enemyManager.rivalReady1 = false;
|
418
|
-
|
419
|
-
enemyManager.turn2 = true;
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
}
|
424
|
-
|
425
|
-
}
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
}
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
```
|