Advertisement
NomadicWarrior

Player script which is prefab

Mar 5th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 115.44 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.Networking;
  6. using UnityEngine.Networking.Types;
  7. using UnityEngine.Networking.Match;
  8.  
  9. public class Player : NetworkBehaviour
  10. {
  11. private GameObject spawnSpot01;
  12. private GameObject spawnSpot02;
  13. private GameObject spawnSpot03;
  14. private GameObject spawnSpot04;
  15. private GameObject spawnSpot05;
  16. private GameObject spawnSpot06;
  17. private GameObject spawnSpot07;
  18. private GameObject spawnSpot08;
  19.  
  20. private GameObject CenterPoint01;
  21. private GameObject CenterPoint02;
  22. private GameObject CenterPoint03;
  23. private GameObject CenterPoint04;
  24.  
  25. private GameObject center;
  26.  
  27. public GameObject card01;
  28. public GameObject card02;
  29. public GameObject card03;
  30. public GameObject card04;
  31. public GameObject card05;
  32. public GameObject card06;
  33. public GameObject card07;
  34. public GameObject card08;
  35.  
  36. public GameObject[] cardCenterSpawn;
  37.  
  38. public int[] cards = new int[32];
  39.  
  40. public GameObject Card;
  41. public CardScript cardScript;
  42.  
  43. public GameObject _game;
  44. public Game _gameScript;
  45.  
  46. public GameObject _text;
  47. public Text TextTest;
  48.  
  49. public GameObject _textScore01;
  50. public Text scoreText01;
  51.  
  52. public GameObject _textScore02;
  53. public Text scoreText02;
  54.  
  55. public GameObject _textGameScore01;
  56. public Text gameScoreText01;
  57.  
  58. public GameObject _textGameScore02;
  59. public Text gameScoreText02;
  60.  
  61. public GameObject _singleton;
  62. public Singleton _singletonScript;
  63.  
  64. public GameObject lobbyManager;
  65. public NetworkLobbyManager lm;
  66.  
  67. public GameObject gameMaster;
  68.  
  69. public string CAT;
  70.  
  71. [SyncVar]
  72. public string Status = "";
  73.  
  74. public string[] playerNames = new string[4];
  75.  
  76. public bool isCardTouched = false;
  77. public string centerCardName;
  78. public int num;
  79. public int stopper;
  80. public string turn;
  81.  
  82. public bool canTurn;
  83.  
  84. public bool firstRound = true;
  85. public GameObject yourNumber;
  86.  
  87. private void Awake()
  88. {
  89. _text = GameObject.FindGameObjectWithTag("text");
  90. }
  91.  
  92. void Start ()
  93. {
  94. spawnSpot01 = GameObject.FindWithTag("sp01");
  95. spawnSpot02 = GameObject.FindWithTag("sp02");
  96. spawnSpot03 = GameObject.FindWithTag("sp03");
  97. spawnSpot04 = GameObject.FindWithTag("sp04");
  98. spawnSpot05 = GameObject.FindWithTag("sp05");
  99. spawnSpot06 = GameObject.FindWithTag("sp06");
  100. spawnSpot07 = GameObject.FindWithTag("sp07");
  101. spawnSpot08 = GameObject.FindWithTag("sp08");
  102.  
  103. CenterPoint01 = GameObject.FindGameObjectWithTag("CenterPoint01");
  104. CenterPoint02 = GameObject.FindGameObjectWithTag("CenterPoint02");
  105. CenterPoint03 = GameObject.FindGameObjectWithTag("CenterPoint03");
  106. CenterPoint04 = GameObject.FindGameObjectWithTag("CenterPoint04");
  107.  
  108. _singleton = GameObject.Find("SINGLETON");
  109. _singletonScript = _singleton.GetComponent<Singleton>();
  110.  
  111. cardCenterSpawn = new GameObject[4];
  112.  
  113. canTurn = true;
  114. stopper = 0;
  115.  
  116. CAT = _singletonScript._yourName;
  117.  
  118. if (isLocalPlayer)
  119. {
  120.  
  121. }
  122. lobbyManager = GameObject.Find("LobbyManager");
  123. lm = lobbyManager.GetComponent<NetworkLobbyManager>();
  124.  
  125. gameMaster = GameObject.Find("GameMaster");
  126. }
  127.  
  128. [Command]
  129. void CmdStatusFunc(string st)
  130. {
  131. Status = st;
  132. }
  133.  
  134. public int a = 0;
  135.  
  136. void Update()
  137. {
  138. if (isLocalPlayer)
  139. {
  140. yourNumber = GameObject.FindGameObjectWithTag("YourNumber");
  141. if (yourNumber != null)
  142. {
  143. Text numText = yourNumber.GetComponent<Text>();
  144. if (_singletonScript.playerMass[0] == _singletonScript._yourName)
  145. {
  146. numText.text = "Ты первый";
  147. }
  148. if (_singletonScript.playerMass[1] == _singletonScript._yourName)
  149. {
  150. numText.text = "Ты второй";
  151. }
  152. if (_singletonScript.playerMass[2] == _singletonScript._yourName)
  153. {
  154. numText.text = "Ты третий";
  155. }
  156. if (_singletonScript.playerMass[3] == _singletonScript._yourName)
  157. {
  158. numText.text = "Ты четвертый";
  159. }
  160. }
  161.  
  162. if (_singletonScript.playerMass[0] == _singletonScript._yourName && _singletonScript.Turn == "First" && stopper == 0)
  163. {
  164. if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
  165. {
  166. if (card01.GetComponent<CardScript>().whichCard == 1 || card02.GetComponent<CardScript>().whichCard == 1 || card03.GetComponent<CardScript>().whichCard == 1 || card04.GetComponent<CardScript>().whichCard == 1 || card05.GetComponent<CardScript>().whichCard == 1 || card06.GetComponent<CardScript>().whichCard == 1 || card07.GetComponent<CardScript>().whichCard == 1 || card08.GetComponent<CardScript>().whichCard == 1)
  167. {
  168. if (card01.GetComponent<CardScript>().whichCard == 1)
  169. {
  170. card01.GetComponent<CardScript>().isPossible = true;
  171. }
  172. else
  173. {
  174. card01.GetComponent<CardScript>().isPossible = false;
  175. }
  176. if (card02.GetComponent<CardScript>().whichCard == 1)
  177. {
  178. card02.GetComponent<CardScript>().isPossible = true;
  179. }
  180. else
  181. {
  182. card02.GetComponent<CardScript>().isPossible = false;
  183. }
  184. if (card03.GetComponent<CardScript>().whichCard == 1)
  185. {
  186. card03.GetComponent<CardScript>().isPossible = true;
  187. }
  188. else
  189. {
  190. card03.GetComponent<CardScript>().isPossible = false;
  191. }
  192. if (card04.GetComponent<CardScript>().whichCard == 1)
  193. {
  194. card04.GetComponent<CardScript>().isPossible = true;
  195. }
  196. else
  197. {
  198. card04.GetComponent<CardScript>().isPossible = false;
  199. }
  200. if (card05.GetComponent<CardScript>().whichCard == 1)
  201. {
  202. card05.GetComponent<CardScript>().isPossible = true;
  203. }
  204. else
  205. {
  206. card05.GetComponent<CardScript>().isPossible = false;
  207. }
  208. if (card06.GetComponent<CardScript>().whichCard == 1)
  209. {
  210. card06.GetComponent<CardScript>().isPossible = true;
  211. }
  212. else
  213. {
  214. card06.GetComponent<CardScript>().isPossible = false;
  215. }
  216. if (card07.GetComponent<CardScript>().whichCard == 1)
  217. {
  218. card07.GetComponent<CardScript>().isPossible = true;
  219. }
  220. else
  221. {
  222. card07.GetComponent<CardScript>().isPossible = false;
  223. }
  224. if (card08.GetComponent<CardScript>().whichCard == 1)
  225. {
  226. card08.GetComponent<CardScript>().isPossible = true;
  227. }
  228. else
  229. {
  230. card08.GetComponent<CardScript>().isPossible = false;
  231. }
  232. }
  233. else if (card01.GetComponent<CardScript>().whichCard == 2 || card02.GetComponent<CardScript>().whichCard == 2 || card03.GetComponent<CardScript>().whichCard == 2 || card04.GetComponent<CardScript>().whichCard == 2 || card05.GetComponent<CardScript>().whichCard == 2 || card06.GetComponent<CardScript>().whichCard == 2 || card07.GetComponent<CardScript>().whichCard == 2 || card08.GetComponent<CardScript>().whichCard == 2)
  234. {
  235. if (card01.GetComponent<CardScript>().whichCard == 2)
  236. {
  237. card01.GetComponent<CardScript>().isPossible = true;
  238.  
  239. }
  240. else
  241. {
  242. card01.GetComponent<CardScript>().isPossible = false;
  243. }
  244. if (card02.GetComponent<CardScript>().whichCard == 2)
  245. {
  246. card02.GetComponent<CardScript>().isPossible = true;
  247.  
  248. }
  249. else
  250. {
  251. card02.GetComponent<CardScript>().isPossible = false;
  252. }
  253. if (card03.GetComponent<CardScript>().whichCard == 2)
  254. {
  255. card03.GetComponent<CardScript>().isPossible = true;
  256.  
  257. }
  258. else
  259. {
  260. card03.GetComponent<CardScript>().isPossible = false;
  261. }
  262. if (card04.GetComponent<CardScript>().whichCard == 2)
  263. {
  264. card04.GetComponent<CardScript>().isPossible = true;
  265.  
  266. }
  267. else
  268. {
  269. card04.GetComponent<CardScript>().isPossible = false;
  270. }
  271. if (card05.GetComponent<CardScript>().whichCard == 2)
  272. {
  273. card05.GetComponent<CardScript>().isPossible = true;
  274.  
  275. }
  276. else
  277. {
  278. card05.GetComponent<CardScript>().isPossible = false;
  279. }
  280. if (card06.GetComponent<CardScript>().whichCard == 2)
  281. {
  282. card06.GetComponent<CardScript>().isPossible = true;
  283.  
  284. }
  285. else
  286. {
  287. card06.GetComponent<CardScript>().isPossible = false;
  288. }
  289. if (card07.GetComponent<CardScript>().whichCard == 2)
  290. {
  291. card07.GetComponent<CardScript>().isPossible = true;
  292.  
  293. }
  294. else
  295. {
  296. card07.GetComponent<CardScript>().isPossible = false;
  297. }
  298. if (card08.GetComponent<CardScript>().whichCard == 2)
  299. {
  300. card08.GetComponent<CardScript>().isPossible = true;
  301.  
  302. }
  303. else
  304. {
  305. card08.GetComponent<CardScript>().isPossible = false;
  306. }
  307. }
  308. }
  309. }
  310. if (_singletonScript.playerMass[1] == _singletonScript._yourName && _singletonScript.Turn == "Second" && stopper == 0)
  311. {
  312. if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
  313. {
  314. if (card01.GetComponent<CardScript>().whichCard == 1 || card02.GetComponent<CardScript>().whichCard == 1 || card03.GetComponent<CardScript>().whichCard == 1 || card04.GetComponent<CardScript>().whichCard == 1 || card05.GetComponent<CardScript>().whichCard == 1 || card06.GetComponent<CardScript>().whichCard == 1 || card07.GetComponent<CardScript>().whichCard == 1 || card08.GetComponent<CardScript>().whichCard == 1)
  315. {
  316. if (card01.GetComponent<CardScript>().whichCard == 1)
  317. {
  318. card01.GetComponent<CardScript>().isPossible = true;
  319.  
  320. }
  321. else
  322. {
  323. card01.GetComponent<CardScript>().isPossible = false;
  324. }
  325. if (card02.GetComponent<CardScript>().whichCard == 1)
  326. {
  327. card02.GetComponent<CardScript>().isPossible = true;
  328.  
  329. }
  330. else
  331. {
  332. card02.GetComponent<CardScript>().isPossible = false;
  333. }
  334. if (card03.GetComponent<CardScript>().whichCard == 1)
  335. {
  336. card03.GetComponent<CardScript>().isPossible = true;
  337.  
  338. }
  339. else
  340. {
  341. card03.GetComponent<CardScript>().isPossible = false;
  342. }
  343. if (card04.GetComponent<CardScript>().whichCard == 1)
  344. {
  345. card04.GetComponent<CardScript>().isPossible = true;
  346.  
  347. }
  348. else
  349. {
  350. card04.GetComponent<CardScript>().isPossible = false;
  351. }
  352. if (card05.GetComponent<CardScript>().whichCard == 1)
  353. {
  354. card05.GetComponent<CardScript>().isPossible = true;
  355.  
  356. }
  357. else
  358. {
  359. card05.GetComponent<CardScript>().isPossible = false;
  360. }
  361. if (card06.GetComponent<CardScript>().whichCard == 1)
  362. {
  363. card06.GetComponent<CardScript>().isPossible = true;
  364.  
  365. }
  366. else
  367. {
  368. card06.GetComponent<CardScript>().isPossible = false;
  369. }
  370. if (card07.GetComponent<CardScript>().whichCard == 1)
  371. {
  372. card07.GetComponent<CardScript>().isPossible = true;
  373.  
  374. }
  375. else
  376. {
  377. card07.GetComponent<CardScript>().isPossible = false;
  378. }
  379. if (card08.GetComponent<CardScript>().whichCard == 1)
  380. {
  381. card08.GetComponent<CardScript>().isPossible = true;
  382.  
  383. }
  384. else
  385. {
  386. card08.GetComponent<CardScript>().isPossible = false;
  387. }
  388. }
  389. else if (card01.GetComponent<CardScript>().whichCard == 2 || card02.GetComponent<CardScript>().whichCard == 2 || card03.GetComponent<CardScript>().whichCard == 2 || card04.GetComponent<CardScript>().whichCard == 2 || card05.GetComponent<CardScript>().whichCard == 2 || card06.GetComponent<CardScript>().whichCard == 2 || card07.GetComponent<CardScript>().whichCard == 2 || card08.GetComponent<CardScript>().whichCard == 2)
  390. {
  391. if (card01.GetComponent<CardScript>().whichCard == 2)
  392. {
  393. card01.GetComponent<CardScript>().isPossible = true;
  394.  
  395. }
  396. else
  397. {
  398. card01.GetComponent<CardScript>().isPossible = false;
  399. }
  400. if (card02.GetComponent<CardScript>().whichCard == 2)
  401. {
  402. card02.GetComponent<CardScript>().isPossible = true;
  403.  
  404. }
  405. else
  406. {
  407. card02.GetComponent<CardScript>().isPossible = false;
  408. }
  409. if (card03.GetComponent<CardScript>().whichCard == 2)
  410. {
  411. card03.GetComponent<CardScript>().isPossible = true;
  412.  
  413. }
  414. else
  415. {
  416. card03.GetComponent<CardScript>().isPossible = false;
  417. }
  418. if (card04.GetComponent<CardScript>().whichCard == 2)
  419. {
  420. card04.GetComponent<CardScript>().isPossible = true;
  421.  
  422. }
  423. else
  424. {
  425. card04.GetComponent<CardScript>().isPossible = false;
  426. }
  427. if (card05.GetComponent<CardScript>().whichCard == 2)
  428. {
  429. card05.GetComponent<CardScript>().isPossible = true;
  430.  
  431. }
  432. else
  433. {
  434. card05.GetComponent<CardScript>().isPossible = false;
  435. }
  436. if (card06.GetComponent<CardScript>().whichCard == 2)
  437. {
  438. card06.GetComponent<CardScript>().isPossible = true;
  439.  
  440. }
  441. else
  442. {
  443. card06.GetComponent<CardScript>().isPossible = false;
  444. }
  445. if (card07.GetComponent<CardScript>().whichCard == 2)
  446. {
  447. card07.GetComponent<CardScript>().isPossible = true;
  448.  
  449. }
  450. else
  451. {
  452. card07.GetComponent<CardScript>().isPossible = false;
  453. }
  454. if (card08.GetComponent<CardScript>().whichCard == 2)
  455. {
  456. card08.GetComponent<CardScript>().isPossible = true;
  457.  
  458. }
  459. else
  460. {
  461. card08.GetComponent<CardScript>().isPossible = false;
  462. }
  463. }
  464. else if (card01.GetComponent<CardScript>().whichCard == 3 || card02.GetComponent<CardScript>().whichCard == 3 || card03.GetComponent<CardScript>().whichCard == 3 || card04.GetComponent<CardScript>().whichCard == 3 || card05.GetComponent<CardScript>().whichCard == 3 || card06.GetComponent<CardScript>().whichCard == 3 || card07.GetComponent<CardScript>().whichCard == 3 || card08.GetComponent<CardScript>().whichCard == 3)
  465. {
  466. if (card01.GetComponent<CardScript>().whichCard == 3)
  467. {
  468. card01.GetComponent<CardScript>().isPossible = true;
  469.  
  470. }
  471. else
  472. {
  473. card01.GetComponent<CardScript>().isPossible = false;
  474. }
  475. if (card02.GetComponent<CardScript>().whichCard == 3)
  476. {
  477. card02.GetComponent<CardScript>().isPossible = true;
  478.  
  479. }
  480. else
  481. {
  482. card02.GetComponent<CardScript>().isPossible = false;
  483. }
  484. if (card03.GetComponent<CardScript>().whichCard == 3)
  485. {
  486. card03.GetComponent<CardScript>().isPossible = true;
  487.  
  488. }
  489. else
  490. {
  491. card03.GetComponent<CardScript>().isPossible = false;
  492. }
  493. if (card04.GetComponent<CardScript>().whichCard == 3)
  494. {
  495. card04.GetComponent<CardScript>().isPossible = true;
  496.  
  497. }
  498. else
  499. {
  500. card04.GetComponent<CardScript>().isPossible = false;
  501. }
  502. if (card05.GetComponent<CardScript>().whichCard == 3)
  503. {
  504. card05.GetComponent<CardScript>().isPossible = true;
  505.  
  506. }
  507. else
  508. {
  509. card05.GetComponent<CardScript>().isPossible = false;
  510. }
  511. if (card06.GetComponent<CardScript>().whichCard == 3)
  512. {
  513. card06.GetComponent<CardScript>().isPossible = true;
  514.  
  515. }
  516. else
  517. {
  518. card06.GetComponent<CardScript>().isPossible = false;
  519. }
  520. if (card07.GetComponent<CardScript>().whichCard == 3)
  521. {
  522. card07.GetComponent<CardScript>().isPossible = true;
  523.  
  524. }
  525. else
  526. {
  527. card07.GetComponent<CardScript>().isPossible = false;
  528. }
  529. if (card08.GetComponent<CardScript>().whichCard == 3)
  530. {
  531. card08.GetComponent<CardScript>().isPossible = true;
  532.  
  533. }
  534. else
  535. {
  536. card08.GetComponent<CardScript>().isPossible = false;
  537. }
  538. }
  539. }
  540. }
  541. if (_singletonScript.playerMass[2] == _singletonScript._yourName && _singletonScript.Turn == "Third" && stopper == 0)
  542. {
  543. if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
  544. {
  545. if (card01.GetComponent<CardScript>().whichCard == 1 || card02.GetComponent<CardScript>().whichCard == 1 || card03.GetComponent<CardScript>().whichCard == 1 || card04.GetComponent<CardScript>().whichCard == 1 || card05.GetComponent<CardScript>().whichCard == 1 || card06.GetComponent<CardScript>().whichCard == 1 || card07.GetComponent<CardScript>().whichCard == 1 || card08.GetComponent<CardScript>().whichCard == 1)
  546. {
  547. if (card01.GetComponent<CardScript>().whichCard == 1)
  548. {
  549. card01.GetComponent<CardScript>().isPossible = true;
  550.  
  551. }
  552. else
  553. {
  554. card01.GetComponent<CardScript>().isPossible = false;
  555. }
  556. if (card02.GetComponent<CardScript>().whichCard == 1)
  557. {
  558. card02.GetComponent<CardScript>().isPossible = true;
  559.  
  560. }
  561. else
  562. {
  563. card02.GetComponent<CardScript>().isPossible = false;
  564. }
  565. if (card03.GetComponent<CardScript>().whichCard == 1)
  566. {
  567. card03.GetComponent<CardScript>().isPossible = true;
  568.  
  569. }
  570. else
  571. {
  572. card03.GetComponent<CardScript>().isPossible = false;
  573. }
  574. if (card04.GetComponent<CardScript>().whichCard == 1)
  575. {
  576. card04.GetComponent<CardScript>().isPossible = true;
  577.  
  578. }
  579. else
  580. {
  581. card04.GetComponent<CardScript>().isPossible = false;
  582. }
  583. if (card05.GetComponent<CardScript>().whichCard == 1)
  584. {
  585. card05.GetComponent<CardScript>().isPossible = true;
  586.  
  587. }
  588. else
  589. {
  590. card05.GetComponent<CardScript>().isPossible = false;
  591. }
  592. if (card06.GetComponent<CardScript>().whichCard == 1)
  593. {
  594. card06.GetComponent<CardScript>().isPossible = true;
  595.  
  596. }
  597. else
  598. {
  599. card06.GetComponent<CardScript>().isPossible = false;
  600. }
  601. if (card07.GetComponent<CardScript>().whichCard == 1)
  602. {
  603. card07.GetComponent<CardScript>().isPossible = true;
  604.  
  605. }
  606. else
  607. {
  608. card07.GetComponent<CardScript>().isPossible = false;
  609. }
  610. if (card08.GetComponent<CardScript>().whichCard == 1)
  611. {
  612. card08.GetComponent<CardScript>().isPossible = true;
  613.  
  614. }
  615. else
  616. {
  617. card08.GetComponent<CardScript>().isPossible = false;
  618. }
  619. }
  620. else if (card01.GetComponent<CardScript>().whichCard == 2 || card02.GetComponent<CardScript>().whichCard == 2 || card03.GetComponent<CardScript>().whichCard == 2 || card04.GetComponent<CardScript>().whichCard == 2 || card05.GetComponent<CardScript>().whichCard == 2 || card06.GetComponent<CardScript>().whichCard == 2 || card07.GetComponent<CardScript>().whichCard == 2 || card08.GetComponent<CardScript>().whichCard == 2)
  621. {
  622. if (card01.GetComponent<CardScript>().whichCard == 2)
  623. {
  624. card01.GetComponent<CardScript>().isPossible = true;
  625.  
  626. }
  627. else
  628. {
  629. card01.GetComponent<CardScript>().isPossible = false;
  630. }
  631. if (card02.GetComponent<CardScript>().whichCard == 2)
  632. {
  633. card02.GetComponent<CardScript>().isPossible = true;
  634.  
  635. }
  636. else
  637. {
  638. card02.GetComponent<CardScript>().isPossible = false;
  639. }
  640. if (card03.GetComponent<CardScript>().whichCard == 2)
  641. {
  642. card03.GetComponent<CardScript>().isPossible = true;
  643.  
  644. }
  645. else
  646. {
  647. card03.GetComponent<CardScript>().isPossible = false;
  648. }
  649. if (card04.GetComponent<CardScript>().whichCard == 2)
  650. {
  651. card04.GetComponent<CardScript>().isPossible = true;
  652.  
  653. }
  654. else
  655. {
  656. card04.GetComponent<CardScript>().isPossible = false;
  657. }
  658. if (card05.GetComponent<CardScript>().whichCard == 2)
  659. {
  660. card05.GetComponent<CardScript>().isPossible = true;
  661.  
  662. }
  663. else
  664. {
  665. card05.GetComponent<CardScript>().isPossible = false;
  666. }
  667. if (card06.GetComponent<CardScript>().whichCard == 2)
  668. {
  669. card06.GetComponent<CardScript>().isPossible = true;
  670.  
  671. }
  672. else
  673. {
  674. card06.GetComponent<CardScript>().isPossible = false;
  675. }
  676. if (card07.GetComponent<CardScript>().whichCard == 2)
  677. {
  678. card07.GetComponent<CardScript>().isPossible = true;
  679.  
  680. }
  681. else
  682. {
  683. card07.GetComponent<CardScript>().isPossible = false;
  684. }
  685. if (card08.GetComponent<CardScript>().whichCard == 2)
  686. {
  687. card08.GetComponent<CardScript>().isPossible = true;
  688.  
  689. }
  690. else
  691. {
  692. card08.GetComponent<CardScript>().isPossible = false;
  693. }
  694. }
  695. else if (card01.GetComponent<CardScript>().whichCard == 3 || card02.GetComponent<CardScript>().whichCard == 3 || card03.GetComponent<CardScript>().whichCard == 3 || card04.GetComponent<CardScript>().whichCard == 3 || card05.GetComponent<CardScript>().whichCard == 3 || card06.GetComponent<CardScript>().whichCard == 3 || card07.GetComponent<CardScript>().whichCard == 3 || card08.GetComponent<CardScript>().whichCard == 3)
  696. {
  697. if (card01.GetComponent<CardScript>().whichCard == 3)
  698. {
  699. card01.GetComponent<CardScript>().isPossible = true;
  700.  
  701. }
  702. else
  703. {
  704. card01.GetComponent<CardScript>().isPossible = false;
  705. }
  706. if (card02.GetComponent<CardScript>().whichCard == 3)
  707. {
  708. card02.GetComponent<CardScript>().isPossible = true;
  709.  
  710. }
  711. else
  712. {
  713. card02.GetComponent<CardScript>().isPossible = false;
  714. }
  715. if (card03.GetComponent<CardScript>().whichCard == 3)
  716. {
  717. card03.GetComponent<CardScript>().isPossible = true;
  718.  
  719. }
  720. else
  721. {
  722. card03.GetComponent<CardScript>().isPossible = false;
  723. }
  724. if (card04.GetComponent<CardScript>().whichCard == 3)
  725. {
  726. card04.GetComponent<CardScript>().isPossible = true;
  727.  
  728. }
  729. else
  730. {
  731. card04.GetComponent<CardScript>().isPossible = false;
  732. }
  733. if (card05.GetComponent<CardScript>().whichCard == 3)
  734. {
  735. card05.GetComponent<CardScript>().isPossible = true;
  736.  
  737. }
  738. else
  739. {
  740. card05.GetComponent<CardScript>().isPossible = false;
  741. }
  742. if (card06.GetComponent<CardScript>().whichCard == 3)
  743. {
  744. card06.GetComponent<CardScript>().isPossible = true;
  745.  
  746. }
  747. else
  748. {
  749. card06.GetComponent<CardScript>().isPossible = false;
  750. }
  751. if (card07.GetComponent<CardScript>().whichCard == 3)
  752. {
  753. card07.GetComponent<CardScript>().isPossible = true;
  754.  
  755. }
  756. else
  757. {
  758. card07.GetComponent<CardScript>().isPossible = false;
  759. }
  760. if (card08.GetComponent<CardScript>().whichCard == 3)
  761. {
  762. card08.GetComponent<CardScript>().isPossible = true;
  763.  
  764. }
  765. else
  766. {
  767. card08.GetComponent<CardScript>().isPossible = false;
  768. }
  769. }
  770. }
  771. }
  772. if (_singletonScript.playerMass[3] == _singletonScript._yourName && _singletonScript.Turn == "Fourth")
  773. {
  774. if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
  775. {
  776. if (card01.GetComponent<CardScript>().whichCard == 1 || card02.GetComponent<CardScript>().whichCard == 1 || card03.GetComponent<CardScript>().whichCard == 1 || card04.GetComponent<CardScript>().whichCard == 1 || card05.GetComponent<CardScript>().whichCard == 1 || card06.GetComponent<CardScript>().whichCard == 1 || card07.GetComponent<CardScript>().whichCard == 1 || card08.GetComponent<CardScript>().whichCard == 1)
  777. {
  778. if (card01.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  779. {
  780. card01.GetComponent<CardScript>().isPossible = true;
  781. }
  782. else
  783. {
  784. card01.GetComponent<CardScript>().isPossible = false;
  785. }
  786. if (card02.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  787. {
  788. card02.GetComponent<CardScript>().isPossible = true;
  789. }
  790. else
  791. {
  792. card02.GetComponent<CardScript>().isPossible = false;
  793. }
  794. if (card03.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  795. {
  796. card03.GetComponent<CardScript>().isPossible = true;
  797. }
  798. else
  799. {
  800. card03.GetComponent<CardScript>().isPossible = false;
  801. }
  802. if (card04.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  803. {
  804. card04.GetComponent<CardScript>().isPossible = true;
  805.  
  806. }
  807. else
  808. {
  809. card04.GetComponent<CardScript>().isPossible = false;
  810. }
  811. if (card05.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  812. {
  813. card05.GetComponent<CardScript>().isPossible = true;
  814.  
  815. }
  816. else
  817. {
  818. card05.GetComponent<CardScript>().isPossible = false;
  819. }
  820. if (card06.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  821. {
  822. card06.GetComponent<CardScript>().isPossible = true;
  823.  
  824. }
  825. else
  826. {
  827. card06.GetComponent<CardScript>().isPossible = false;
  828. }
  829. if (card07.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  830. {
  831. card07.GetComponent<CardScript>().isPossible = true;
  832.  
  833. }
  834. else
  835. {
  836. card07.GetComponent<CardScript>().isPossible = false;
  837. }
  838. if (card08.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
  839. {
  840. card08.GetComponent<CardScript>().isPossible = true;
  841.  
  842. }
  843. else
  844. {
  845. card08.GetComponent<CardScript>().isPossible = false;
  846. }
  847. }
  848. else if (card01.GetComponent<CardScript>().whichCard == 2 || card02.GetComponent<CardScript>().whichCard == 2 || card03.GetComponent<CardScript>().whichCard == 2 || card04.GetComponent<CardScript>().whichCard == 2 || card05.GetComponent<CardScript>().whichCard == 2 || card06.GetComponent<CardScript>().whichCard == 2 || card07.GetComponent<CardScript>().whichCard == 2 || card08.GetComponent<CardScript>().whichCard == 2)
  849. {
  850. if (card01.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  851. {
  852. card01.GetComponent<CardScript>().isPossible = true;
  853.  
  854. }
  855. else
  856. {
  857. card01.GetComponent<CardScript>().isPossible = false;
  858. }
  859. if (card02.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  860. {
  861. card02.GetComponent<CardScript>().isPossible = true;
  862.  
  863. }
  864. else
  865. {
  866. card02.GetComponent<CardScript>().isPossible = false;
  867. }
  868. if (card03.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  869. {
  870. card03.GetComponent<CardScript>().isPossible = true;
  871.  
  872. }
  873. else
  874. {
  875. card03.GetComponent<CardScript>().isPossible = false;
  876. }
  877. if (card04.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  878. {
  879. card04.GetComponent<CardScript>().isPossible = true;
  880.  
  881. }
  882. else
  883. {
  884. card04.GetComponent<CardScript>().isPossible = false;
  885. }
  886. if (card05.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  887. {
  888. card05.GetComponent<CardScript>().isPossible = true;
  889.  
  890. }
  891. else
  892. {
  893. card05.GetComponent<CardScript>().isPossible = false;
  894. }
  895. if (card06.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  896. {
  897. card06.GetComponent<CardScript>().isPossible = true;
  898.  
  899. }
  900. else
  901. {
  902. card06.GetComponent<CardScript>().isPossible = false;
  903. }
  904. if (card07.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  905. {
  906. card07.GetComponent<CardScript>().isPossible = true;
  907.  
  908. }
  909. else
  910. {
  911. card07.GetComponent<CardScript>().isPossible = false;
  912. }
  913. if (card08.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
  914. {
  915. card08.GetComponent<CardScript>().isPossible = true;
  916.  
  917. }
  918. else
  919. {
  920. card08.GetComponent<CardScript>().isPossible = false;
  921. }
  922. }
  923. else if (card01.GetComponent<CardScript>().whichCard == 3 || card02.GetComponent<CardScript>().whichCard == 3 || card03.GetComponent<CardScript>().whichCard == 3 || card04.GetComponent<CardScript>().whichCard == 3 || card05.GetComponent<CardScript>().whichCard == 3 || card06.GetComponent<CardScript>().whichCard == 3 || card07.GetComponent<CardScript>().whichCard == 3 || card08.GetComponent<CardScript>().whichCard == 3)
  924. {
  925. if (card01.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  926. {
  927. card01.GetComponent<CardScript>().isPossible = true;
  928.  
  929. }
  930. else
  931. {
  932. card01.GetComponent<CardScript>().isPossible = false;
  933. }
  934. if (card02.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  935. {
  936. card02.GetComponent<CardScript>().isPossible = true;
  937.  
  938. }
  939. else
  940. {
  941. card02.GetComponent<CardScript>().isPossible = false;
  942. }
  943. if (card03.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  944. {
  945. card03.GetComponent<CardScript>().isPossible = true;
  946.  
  947. }
  948. else
  949. {
  950. card03.GetComponent<CardScript>().isPossible = false;
  951. }
  952. if (card04.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  953. {
  954. card04.GetComponent<CardScript>().isPossible = true;
  955.  
  956. }
  957. else
  958. {
  959. card04.GetComponent<CardScript>().isPossible = false;
  960. }
  961. if (card05.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  962. {
  963. card05.GetComponent<CardScript>().isPossible = true;
  964.  
  965. }
  966. else
  967. {
  968. card05.GetComponent<CardScript>().isPossible = false;
  969. }
  970. if (card06.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  971. {
  972. card06.GetComponent<CardScript>().isPossible = true;
  973.  
  974. }
  975. else
  976. {
  977. card06.GetComponent<CardScript>().isPossible = false;
  978. }
  979. if (card07.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  980. {
  981. card07.GetComponent<CardScript>().isPossible = true;
  982.  
  983. }
  984. else
  985. {
  986. card07.GetComponent<CardScript>().isPossible = false;
  987. }
  988. if (card08.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
  989. {
  990. card08.GetComponent<CardScript>().isPossible = true;
  991.  
  992. }
  993. else
  994. {
  995. card08.GetComponent<CardScript>().isPossible = false;
  996. }
  997. }
  998. }
  999. }
  1000.  
  1001. _game = GameObject.FindGameObjectWithTag("Game");
  1002. _text = GameObject.FindGameObjectWithTag("text");
  1003.  
  1004. _textScore01 = GameObject.FindGameObjectWithTag("TextScore01");
  1005. _textScore02 = GameObject.FindGameObjectWithTag("TextScore02");
  1006.  
  1007. if (_singletonScript.isScore == true)
  1008. {
  1009. scoreText01 = _textScore01.GetComponent<Text>();
  1010. scoreText01.text = "Team One Score: " + _singletonScript.ScoreTeamOne.ToString();
  1011. scoreText02 = _textScore02.GetComponent<Text>();
  1012. scoreText02.text = "Team Two Score: " + _singletonScript.ScoreTeamTwo.ToString();
  1013. _singletonScript.isScore = false;
  1014. }
  1015.  
  1016. if (_game != null)
  1017. {
  1018. _gameScript = _game.GetComponent<Game>();
  1019. }
  1020.  
  1021. if (_singletonScript.NewRound == true)
  1022. {
  1023. CmdCardShuffle();
  1024. StartCoroutine(WaitAndRecieve());
  1025. turn = "First";
  1026. CmdTurner("First");
  1027. _singletonScript.NewRound = false;
  1028. }
  1029.  
  1030. if (isCardTouched == true)
  1031. {
  1032. if (num == 1)
  1033. {
  1034. CmdTurner("Second");
  1035. CmdCenterSpawner(centerCardName, num);
  1036. turn = "Second";
  1037. num = 0;
  1038. }
  1039. else if (num == 2)
  1040. {
  1041. CmdTurner("Third");
  1042. CmdCenterSpawner(centerCardName, num);
  1043. turn = "Third";
  1044. num = 0;
  1045. }
  1046. else if (num == 3)
  1047. {
  1048. CmdTurner("Fourth");
  1049. CmdCenterSpawner(centerCardName, num);
  1050. turn = "Fourth";
  1051. num = 0;
  1052. }
  1053. else if (num == 4)
  1054. {
  1055. CmdCenterSpawner(centerCardName, num);
  1056. StartCoroutine(WaitAndDelete());
  1057. turn = "First";
  1058. num = 0;
  1059. }
  1060. isCardTouched = false;
  1061. StartCoroutine(WaitAndStopper());
  1062. }
  1063.  
  1064. if (Input.GetKeyDown(KeyCode.A))
  1065. {
  1066.  
  1067. }
  1068. }
  1069. }
  1070.  
  1071. public IEnumerator WaitAndMrCat()
  1072. {
  1073. yield return new WaitForSeconds(0.7f);
  1074. CmdMrCat();
  1075. }
  1076. [Command]
  1077. public void CmdMrCat()
  1078. {
  1079. RpcMrCat();
  1080. }
  1081. [ClientRpc]
  1082. public void RpcMrCat()
  1083. {
  1084. if (_singletonScript.CardRanks[1] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[1] > _singletonScript.CardRanks[2] && _singletonScript.CardRanks[1] > _singletonScript.CardRanks[3])
  1085. {
  1086. string temp = _singletonScript.playerMass[0];
  1087. _singletonScript.playerMass[0] = _singletonScript.playerMass[1];
  1088. _singletonScript.playerMass[1] = _singletonScript.playerMass[2];
  1089. _singletonScript.playerMass[2] = _singletonScript.playerMass[3];
  1090. _singletonScript.playerMass[3] = temp;
  1091. }
  1092. else if (_singletonScript.CardRanks[2] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[2] > _singletonScript.CardRanks[1] && _singletonScript.CardRanks[2] > _singletonScript.CardRanks[3])
  1093. {
  1094. string temp = _singletonScript.playerMass[0];
  1095. _singletonScript.playerMass[0] = _singletonScript.playerMass[2];
  1096. string temp2 = _singletonScript.playerMass[1];
  1097. _singletonScript.playerMass[1] = _singletonScript.playerMass[3];
  1098. _singletonScript.playerMass[2] = temp;
  1099. _singletonScript.playerMass[3] = temp2;
  1100. }
  1101. else if (_singletonScript.CardRanks[3] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[3] > _singletonScript.CardRanks[1] && _singletonScript.CardRanks[3] > _singletonScript.CardRanks[2])
  1102. {
  1103. string temp = _singletonScript.playerMass[0];
  1104. _singletonScript.playerMass[0] = _singletonScript.playerMass[3];
  1105. string temp2 = _singletonScript.playerMass[1];
  1106. _singletonScript.playerMass[1] = temp;
  1107. string temp3 = _singletonScript.playerMass[2];
  1108. _singletonScript.playerMass[2] = temp2;
  1109. _singletonScript.playerMass[3] = temp3;
  1110. }
  1111. }
  1112.  
  1113. public IEnumerator WaitAndStopper()
  1114. {
  1115. yield return new WaitForSeconds(0.7f);
  1116. stopper = 0;
  1117. }
  1118.  
  1119. public IEnumerator WaitAndRecieve()
  1120. {
  1121. yield return new WaitForSeconds(1f);
  1122. CardRecieve(_singletonScript.cards);
  1123. }
  1124. public GameObject cat;
  1125. public int i = 0;
  1126.  
  1127. // ------- Рандомное перемешивание карт -------
  1128. [Command]
  1129. void CmdCardShuffle()
  1130. {
  1131. int[] cardsArr = new int[32];
  1132.  
  1133. for (int i = 0; i < 32; i++)
  1134. {
  1135. cardsArr[i] = i + 1;
  1136. }
  1137.  
  1138. for (int i = 31; i >= 0; i--)
  1139. {
  1140. int j = Random.Range(0, i + 1);
  1141.  
  1142. int temp = cardsArr[j];
  1143. cardsArr[j] = cardsArr[i];
  1144. cardsArr[i] = temp;
  1145. RpcCardShuffle(i, cardsArr[i]);
  1146. }
  1147. }
  1148. [ClientRpc]
  1149. void RpcCardShuffle(int i,int value)
  1150. {
  1151. _singletonScript.cards[i] = value;
  1152. }
  1153.  
  1154. // ------- Удаление кард после хода 4 игрока -------
  1155. public IEnumerator WaitAndDelete()
  1156. {
  1157. yield return new WaitForSeconds(0.5f);
  1158. CmdMrCat();
  1159. CmdCenterRemover();
  1160. CmdTurner("First");
  1161. }
  1162. [Command]
  1163. public void CmdCenterRemover()
  1164. {
  1165. RpcCenterRemover();
  1166. }
  1167. [ClientRpc]
  1168. public void RpcCenterRemover()
  1169. {
  1170. for (int i = 0; i < 4; i++)
  1171. {
  1172. Destroy(_singletonScript.arr[i]);
  1173. }
  1174. }
  1175.  
  1176. // ------- Смена хода игроков -------
  1177. [Command]
  1178. public void CmdTurner(string text)
  1179. {
  1180. RpcTurner(text);
  1181. }
  1182. [ClientRpc]
  1183. public void RpcTurner(string text)
  1184. {
  1185. _singletonScript.turner(text);
  1186. }
  1187.  
  1188. // ------- Рандом -------
  1189. [Command]
  1190. public void CmdRandom()
  1191. {
  1192. int rand = Random.Range(0, 100);
  1193. RpcRandom(rand);
  1194. }
  1195. [ClientRpc]
  1196. public void RpcRandom(int value)
  1197. {
  1198. _singletonScript.RANDOMSYNC = value;
  1199. }
  1200.  
  1201. // ------- Спавн карт в центре стола у всех игроков с заданными параметрами -------
  1202. [Command]
  1203. public void CmdCenterSpawner(string value, int nam)
  1204. {
  1205. RpcCenterSpawner(value, nam);
  1206. }
  1207. [ClientRpc]
  1208. public void RpcCenterSpawner(string value, int nam)
  1209. {
  1210. if (_singletonScript.playerMass[0] == _singletonScript._yourName)
  1211. {
  1212. if (nam == 1)
  1213. {
  1214. center = CenterPoint01;
  1215. cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1216. cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
  1217. _singletonScript.arr[0] = cardCenterSpawn[0];
  1218. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1219. {
  1220. if (_singletonScript.RoundTrump == "Clubs")
  1221. {
  1222. _singletonScript.FirstCardCenterRanking("Trump");
  1223. }
  1224. else
  1225. {
  1226. _singletonScript.FirstCardCenterRanking("Clubs");
  1227. }
  1228. }
  1229. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1230. {
  1231. if (_singletonScript.RoundTrump == "Spades")
  1232. {
  1233. _singletonScript.FirstCardCenterRanking("Trump");
  1234. }
  1235. else
  1236. {
  1237. _singletonScript.FirstCardCenterRanking("Spades");
  1238. }
  1239. }
  1240. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1241. {
  1242. if (_singletonScript.RoundTrump == "Hearts")
  1243. {
  1244. _singletonScript.FirstCardCenterRanking("Trump");
  1245. }
  1246. else
  1247. {
  1248. _singletonScript.FirstCardCenterRanking("Hearts");
  1249. }
  1250. }
  1251. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1252. {
  1253. if (_singletonScript.RoundTrump == "Diamonds")
  1254. {
  1255. _singletonScript.FirstCardCenterRanking("Trump");
  1256. }
  1257. else
  1258. {
  1259. _singletonScript.FirstCardCenterRanking("Diamonds");
  1260. }
  1261. }
  1262. if (value == "17" || value == "18" || value == "19" || value == "20")
  1263. {
  1264. _singletonScript.FirstCardCenterRanking("Trump");
  1265. }
  1266. }
  1267. if (nam == 2)
  1268. {
  1269. center = CenterPoint02;
  1270. cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1271. cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
  1272. _singletonScript.arr[1] = cardCenterSpawn[1];
  1273. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1274. {
  1275. if (_singletonScript.RoundTrump == "Clubs")
  1276. {
  1277. _singletonScript.SecondCardCenterRanking("Trump");
  1278. }
  1279. else
  1280. {
  1281. _singletonScript.SecondCardCenterRanking("Clubs");
  1282. }
  1283. }
  1284. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1285. {
  1286. if (_singletonScript.RoundTrump == "Spades")
  1287. {
  1288. _singletonScript.SecondCardCenterRanking("Trump");
  1289. }
  1290. else
  1291. {
  1292. _singletonScript.SecondCardCenterRanking("Spades");
  1293. }
  1294. }
  1295. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1296. {
  1297. if (_singletonScript.RoundTrump == "Hearts")
  1298. {
  1299. _singletonScript.SecondCardCenterRanking("Trump");
  1300. }
  1301. else
  1302. {
  1303. _singletonScript.SecondCardCenterRanking("Hearts");
  1304. }
  1305. }
  1306. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1307. {
  1308. if (_singletonScript.RoundTrump == "Diamonds")
  1309. {
  1310. _singletonScript.SecondCardCenterRanking("Trump");
  1311. }
  1312. else
  1313. {
  1314. _singletonScript.SecondCardCenterRanking("Diamonds");
  1315. }
  1316. }
  1317. if (value == "17" || value == "18" || value == "19" || value == "20")
  1318. {
  1319. _singletonScript.SecondCardCenterRanking("Trump");
  1320. }
  1321. }
  1322. if (nam == 3)
  1323. {
  1324. center = CenterPoint03;
  1325. cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1326. cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
  1327. _singletonScript.arr[2] = cardCenterSpawn[2];
  1328. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1329. {
  1330. if (_singletonScript.RoundTrump == "Clubs")
  1331. {
  1332. _singletonScript.ThirdCardCenterRanking("Trump");
  1333. }
  1334. else
  1335. {
  1336. _singletonScript.ThirdCardCenterRanking("Clubs");
  1337. }
  1338. }
  1339. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1340. {
  1341. if (_singletonScript.RoundTrump == "Spades")
  1342. {
  1343. _singletonScript.ThirdCardCenterRanking("Trump");
  1344. }
  1345. else
  1346. {
  1347. _singletonScript.ThirdCardCenterRanking("Spades");
  1348. }
  1349. }
  1350. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1351. {
  1352. if (_singletonScript.RoundTrump == "Hearts")
  1353. {
  1354. _singletonScript.ThirdCardCenterRanking("Trump");
  1355. }
  1356. else
  1357. {
  1358. _singletonScript.ThirdCardCenterRanking("Hearts");
  1359. }
  1360. }
  1361. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1362. {
  1363. if (_singletonScript.RoundTrump == "Diamonds")
  1364. {
  1365. _singletonScript.ThirdCardCenterRanking("Trump");
  1366. }
  1367. else
  1368. {
  1369. _singletonScript.ThirdCardCenterRanking("Diamonds");
  1370. }
  1371. }
  1372. if (value == "17" || value == "18" || value == "19" || value == "20")
  1373. {
  1374. _singletonScript.ThirdCardCenterRanking("Trump");
  1375. }
  1376. }
  1377. if (nam == 4)
  1378. {
  1379. center = CenterPoint04;
  1380. cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1381. cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
  1382. _singletonScript.arr[3] = cardCenterSpawn[3];
  1383. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1384. {
  1385. if (_singletonScript.RoundTrump == "Clubs")
  1386. {
  1387. _singletonScript.FourthCardCenterRanking("Trump");
  1388. }
  1389. else
  1390. {
  1391. _singletonScript.FourthCardCenterRanking("Clubs");
  1392. }
  1393. }
  1394. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1395. {
  1396. if (_singletonScript.RoundTrump == "Spades")
  1397. {
  1398. _singletonScript.FourthCardCenterRanking("Trump");
  1399. }
  1400. else
  1401. {
  1402. _singletonScript.FourthCardCenterRanking("Spades");
  1403. }
  1404. }
  1405. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1406. {
  1407. if (_singletonScript.RoundTrump == "Hearts")
  1408. {
  1409. _singletonScript.FourthCardCenterRanking("Trump");
  1410. }
  1411. else
  1412. {
  1413. _singletonScript.FourthCardCenterRanking("Hearts");
  1414. }
  1415. }
  1416. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1417. {
  1418. if (_singletonScript.RoundTrump == "Diamonds")
  1419. {
  1420. _singletonScript.FourthCardCenterRanking("Trump");
  1421. }
  1422. else
  1423. {
  1424. _singletonScript.FourthCardCenterRanking("Diamonds");
  1425. }
  1426. }
  1427. if (value == "17" || value == "18" || value == "19" || value == "20")
  1428. {
  1429. _singletonScript.FourthCardCenterRanking("Trump");
  1430. }
  1431. }
  1432. }
  1433. if (_singletonScript.playerMass[1] == _singletonScript._yourName)
  1434. {
  1435. if (nam == 1)
  1436. {
  1437. center = CenterPoint04;
  1438. cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1439. cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
  1440. _singletonScript.arr[0] = cardCenterSpawn[0];
  1441. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1442. {
  1443. if (_singletonScript.RoundTrump == "Clubs")
  1444. {
  1445. _singletonScript.FirstCardCenterRanking("Trump");
  1446. }
  1447. else
  1448. {
  1449. _singletonScript.FirstCardCenterRanking("Clubs");
  1450. }
  1451. }
  1452. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1453. {
  1454. if (_singletonScript.RoundTrump == "Spades")
  1455. {
  1456. _singletonScript.FirstCardCenterRanking("Trump");
  1457. }
  1458. else
  1459. {
  1460. _singletonScript.FirstCardCenterRanking("Spades");
  1461. }
  1462. }
  1463. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1464. {
  1465. if (_singletonScript.RoundTrump == "Hearts")
  1466. {
  1467. _singletonScript.FirstCardCenterRanking("Trump");
  1468. }
  1469. else
  1470. {
  1471. _singletonScript.FirstCardCenterRanking("Hearts");
  1472. }
  1473. }
  1474. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1475. {
  1476. if (_singletonScript.RoundTrump == "Diamonds")
  1477. {
  1478. _singletonScript.FirstCardCenterRanking("Trump");
  1479. }
  1480. else
  1481. {
  1482. _singletonScript.FirstCardCenterRanking("Diamonds");
  1483. }
  1484. }
  1485. if (value == "17" || value == "18" || value == "19" || value == "20")
  1486. {
  1487. _singletonScript.FirstCardCenterRanking("Trump");
  1488. }
  1489. }
  1490. if (nam == 2)
  1491. {
  1492. center = CenterPoint01;
  1493. cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1494. cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
  1495. _singletonScript.arr[1] = cardCenterSpawn[1];
  1496. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1497. {
  1498. if (_singletonScript.RoundTrump == "Clubs")
  1499. {
  1500. _singletonScript.SecondCardCenterRanking("Trump");
  1501. }
  1502. else
  1503. {
  1504. _singletonScript.SecondCardCenterRanking("Clubs");
  1505. }
  1506. }
  1507. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1508. {
  1509. if (_singletonScript.RoundTrump == "Spades")
  1510. {
  1511. _singletonScript.SecondCardCenterRanking("Trump");
  1512. }
  1513. else
  1514. {
  1515. _singletonScript.SecondCardCenterRanking("Spades");
  1516. }
  1517. }
  1518. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1519. {
  1520. if (_singletonScript.RoundTrump == "Hearts")
  1521. {
  1522. _singletonScript.SecondCardCenterRanking("Trump");
  1523. }
  1524. else
  1525. {
  1526. _singletonScript.SecondCardCenterRanking("Hearts");
  1527. }
  1528. }
  1529. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1530. {
  1531. if (_singletonScript.RoundTrump == "Diamonds")
  1532. {
  1533. _singletonScript.SecondCardCenterRanking("Trump");
  1534. }
  1535. else
  1536. {
  1537. _singletonScript.SecondCardCenterRanking("Diamonds");
  1538. }
  1539. }
  1540. if (value == "17" || value == "18" || value == "19" || value == "20")
  1541. {
  1542. _singletonScript.SecondCardCenterRanking("Trump");
  1543. }
  1544. }
  1545. if (nam == 3)
  1546. {
  1547. center = CenterPoint02;
  1548. cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1549. cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
  1550. _singletonScript.arr[2] = cardCenterSpawn[2];
  1551. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1552. {
  1553. if (_singletonScript.RoundTrump == "Clubs")
  1554. {
  1555. _singletonScript.ThirdCardCenterRanking("Trump");
  1556. }
  1557. else
  1558. {
  1559. _singletonScript.ThirdCardCenterRanking("Clubs");
  1560. }
  1561. }
  1562. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1563. {
  1564. if (_singletonScript.RoundTrump == "Spades")
  1565. {
  1566. _singletonScript.ThirdCardCenterRanking("Trump");
  1567. }
  1568. else
  1569. {
  1570. _singletonScript.ThirdCardCenterRanking("Spades");
  1571. }
  1572. }
  1573. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1574. {
  1575. if (_singletonScript.RoundTrump == "Hearts")
  1576. {
  1577. _singletonScript.ThirdCardCenterRanking("Trump");
  1578. }
  1579. else
  1580. {
  1581. _singletonScript.ThirdCardCenterRanking("Hearts");
  1582. }
  1583. }
  1584. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1585. {
  1586. if (_singletonScript.RoundTrump == "Diamonds")
  1587. {
  1588. _singletonScript.ThirdCardCenterRanking("Trump");
  1589. }
  1590. else
  1591. {
  1592. _singletonScript.ThirdCardCenterRanking("Diamonds");
  1593. }
  1594. }
  1595. if (value == "17" || value == "18" || value == "19" || value == "20")
  1596. {
  1597. _singletonScript.ThirdCardCenterRanking("Trump");
  1598. }
  1599. }
  1600. if (nam == 4)
  1601. {
  1602. center = CenterPoint03;
  1603. cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1604. cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
  1605. _singletonScript.arr[3] = cardCenterSpawn[3];
  1606. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1607. {
  1608. if (_singletonScript.RoundTrump == "Clubs")
  1609. {
  1610. _singletonScript.FourthCardCenterRanking("Trump");
  1611. }
  1612. else
  1613. {
  1614. _singletonScript.FourthCardCenterRanking("Clubs");
  1615. }
  1616. }
  1617. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1618. {
  1619. if (_singletonScript.RoundTrump == "Spades")
  1620. {
  1621. _singletonScript.FourthCardCenterRanking("Trump");
  1622. }
  1623. else
  1624. {
  1625. _singletonScript.FourthCardCenterRanking("Spades");
  1626. }
  1627. }
  1628. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1629. {
  1630. if (_singletonScript.RoundTrump == "Hearts")
  1631. {
  1632. _singletonScript.FourthCardCenterRanking("Trump");
  1633. }
  1634. else
  1635. {
  1636. _singletonScript.FourthCardCenterRanking("Hearts");
  1637. }
  1638. }
  1639. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1640. {
  1641. if (_singletonScript.RoundTrump == "Diamonds")
  1642. {
  1643. _singletonScript.FourthCardCenterRanking("Trump");
  1644. }
  1645. else
  1646. {
  1647. _singletonScript.FourthCardCenterRanking("Diamonds");
  1648. }
  1649. }
  1650. if (value == "17" || value == "18" || value == "19" || value == "20")
  1651. {
  1652. _singletonScript.FourthCardCenterRanking("Trump");
  1653. }
  1654. }
  1655. }
  1656. if (_singletonScript.playerMass[2] == _singletonScript._yourName)
  1657. {
  1658. if (nam == 1)
  1659. {
  1660. center = CenterPoint03;
  1661. cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1662. cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
  1663. _singletonScript.arr[0] = cardCenterSpawn[0];
  1664. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1665. {
  1666. if (_singletonScript.RoundTrump == "Clubs")
  1667. {
  1668. _singletonScript.FirstCardCenterRanking("Trump");
  1669. }
  1670. else
  1671. {
  1672. _singletonScript.FirstCardCenterRanking("Clubs");
  1673. }
  1674. }
  1675. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1676. {
  1677. if (_singletonScript.RoundTrump == "Spades")
  1678. {
  1679. _singletonScript.FirstCardCenterRanking("Trump");
  1680. }
  1681. else
  1682. {
  1683. _singletonScript.FirstCardCenterRanking("Spades");
  1684. }
  1685. }
  1686. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1687. {
  1688. if (_singletonScript.RoundTrump == "Hearts")
  1689. {
  1690. _singletonScript.FirstCardCenterRanking("Trump");
  1691. }
  1692. else
  1693. {
  1694. _singletonScript.FirstCardCenterRanking("Hearts");
  1695. }
  1696. }
  1697. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1698. {
  1699. if (_singletonScript.RoundTrump == "Diamonds")
  1700. {
  1701. _singletonScript.FirstCardCenterRanking("Trump");
  1702. }
  1703. else
  1704. {
  1705. _singletonScript.FirstCardCenterRanking("Diamonds");
  1706. }
  1707. }
  1708. if (value == "17" || value == "18" || value == "19" || value == "20")
  1709. {
  1710. _singletonScript.FirstCardCenterRanking("Trump");
  1711. }
  1712. }
  1713. if (nam == 2)
  1714. {
  1715. center = CenterPoint04;
  1716. cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1717. cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
  1718. _singletonScript.arr[1] = cardCenterSpawn[1];
  1719. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1720. {
  1721. if (_singletonScript.RoundTrump == "Clubs")
  1722. {
  1723. _singletonScript.SecondCardCenterRanking("Trump");
  1724. }
  1725. else
  1726. {
  1727. _singletonScript.SecondCardCenterRanking("Clubs");
  1728. }
  1729. }
  1730. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1731. {
  1732. if (_singletonScript.RoundTrump == "Spades")
  1733. {
  1734. _singletonScript.SecondCardCenterRanking("Trump");
  1735. }
  1736. else
  1737. {
  1738. _singletonScript.SecondCardCenterRanking("Spades");
  1739. }
  1740. }
  1741. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1742. {
  1743. if (_singletonScript.RoundTrump == "Hearts")
  1744. {
  1745. _singletonScript.SecondCardCenterRanking("Trump");
  1746. }
  1747. else
  1748. {
  1749. _singletonScript.SecondCardCenterRanking("Hearts");
  1750. }
  1751. }
  1752. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1753. {
  1754. if (_singletonScript.RoundTrump == "Diamonds")
  1755. {
  1756. _singletonScript.SecondCardCenterRanking("Trump");
  1757. }
  1758. else
  1759. {
  1760. _singletonScript.SecondCardCenterRanking("Diamonds");
  1761. }
  1762. }
  1763. if (value == "17" || value == "18" || value == "19" || value == "20")
  1764. {
  1765. _singletonScript.SecondCardCenterRanking("Trump");
  1766. }
  1767. }
  1768. if (nam == 3)
  1769. {
  1770. center = CenterPoint01;
  1771. cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1772. cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
  1773. _singletonScript.arr[2] = cardCenterSpawn[2];
  1774. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1775. {
  1776. if (_singletonScript.RoundTrump == "Clubs")
  1777. {
  1778. _singletonScript.ThirdCardCenterRanking("Trump");
  1779. }
  1780. else
  1781. {
  1782. _singletonScript.ThirdCardCenterRanking("Clubs");
  1783. }
  1784. }
  1785. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1786. {
  1787. if (_singletonScript.RoundTrump == "Spades")
  1788. {
  1789. _singletonScript.ThirdCardCenterRanking("Trump");
  1790. }
  1791. else
  1792. {
  1793. _singletonScript.ThirdCardCenterRanking("Spades");
  1794. }
  1795. }
  1796. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1797. {
  1798. if (_singletonScript.RoundTrump == "Hearts")
  1799. {
  1800. _singletonScript.ThirdCardCenterRanking("Trump");
  1801. }
  1802. else
  1803. {
  1804. _singletonScript.ThirdCardCenterRanking("Hearts");
  1805. }
  1806. }
  1807. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1808. {
  1809. if (_singletonScript.RoundTrump == "Diamonds")
  1810. {
  1811. _singletonScript.ThirdCardCenterRanking("Trump");
  1812. }
  1813. else
  1814. {
  1815. _singletonScript.ThirdCardCenterRanking("Diamonds");
  1816. }
  1817. }
  1818. if (value == "17" || value == "18" || value == "19" || value == "20")
  1819. {
  1820. _singletonScript.ThirdCardCenterRanking("Trump");
  1821. }
  1822. }
  1823. if (nam == 4)
  1824. {
  1825. center = CenterPoint02;
  1826. cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1827. cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
  1828. _singletonScript.arr[3] = cardCenterSpawn[3];
  1829. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1830. {
  1831. if (_singletonScript.RoundTrump == "Clubs")
  1832. {
  1833. _singletonScript.FourthCardCenterRanking("Trump");
  1834. }
  1835. else
  1836. {
  1837. _singletonScript.FourthCardCenterRanking("Clubs");
  1838. }
  1839. }
  1840. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1841. {
  1842. if (_singletonScript.RoundTrump == "Spades")
  1843. {
  1844. _singletonScript.FourthCardCenterRanking("Trump");
  1845. }
  1846. else
  1847. {
  1848. _singletonScript.FourthCardCenterRanking("Spades");
  1849. }
  1850. }
  1851. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1852. {
  1853. if (_singletonScript.RoundTrump == "Hearts")
  1854. {
  1855. _singletonScript.FourthCardCenterRanking("Trump");
  1856. }
  1857. else
  1858. {
  1859. _singletonScript.FourthCardCenterRanking("Hearts");
  1860. }
  1861. }
  1862. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1863. {
  1864. if (_singletonScript.RoundTrump == "Diamonds")
  1865. {
  1866. _singletonScript.FourthCardCenterRanking("Trump");
  1867. }
  1868. else
  1869. {
  1870. _singletonScript.FourthCardCenterRanking("Diamonds");
  1871. }
  1872. }
  1873. if (value == "17" || value == "18" || value == "19" || value == "20")
  1874. {
  1875. _singletonScript.FourthCardCenterRanking("Trump");
  1876. }
  1877. }
  1878. }
  1879. if (_singletonScript.playerMass[3] == _singletonScript._yourName)
  1880. {
  1881. if (nam == 1)
  1882. {
  1883. center = CenterPoint02;
  1884. cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1885. cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
  1886. _singletonScript.arr[0] = cardCenterSpawn[0];
  1887. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1888. {
  1889. if (_singletonScript.RoundTrump == "Clubs")
  1890. {
  1891. _singletonScript.FirstCardCenterRanking("Trump");
  1892. }
  1893. else
  1894. {
  1895. _singletonScript.FirstCardCenterRanking("Clubs");
  1896. }
  1897. }
  1898. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1899. {
  1900. if (_singletonScript.RoundTrump == "Spades")
  1901. {
  1902. _singletonScript.FirstCardCenterRanking("Trump");
  1903. }
  1904. else
  1905. {
  1906. _singletonScript.FirstCardCenterRanking("Spades");
  1907. }
  1908. }
  1909. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1910. {
  1911. if (_singletonScript.RoundTrump == "Hearts")
  1912. {
  1913. _singletonScript.FirstCardCenterRanking("Trump");
  1914. }
  1915. else
  1916. {
  1917. _singletonScript.FirstCardCenterRanking("Hearts");
  1918. }
  1919. }
  1920. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1921. {
  1922. if (_singletonScript.RoundTrump == "Diamonds")
  1923. {
  1924. _singletonScript.FirstCardCenterRanking("Trump");
  1925. }
  1926. else
  1927. {
  1928. _singletonScript.FirstCardCenterRanking("Diamonds");
  1929. }
  1930. }
  1931. if (value == "17" || value == "18" || value == "19" || value == "20")
  1932. {
  1933. _singletonScript.FirstCardCenterRanking("Trump");
  1934. }
  1935. }
  1936. if (nam == 2)
  1937. {
  1938. center = CenterPoint03;
  1939. cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1940. cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
  1941. _singletonScript.arr[1] = cardCenterSpawn[1];
  1942. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1943. {
  1944. if (_singletonScript.RoundTrump == "Clubs")
  1945. {
  1946. _singletonScript.SecondCardCenterRanking("Trump");
  1947. }
  1948. else
  1949. {
  1950. _singletonScript.SecondCardCenterRanking("Clubs");
  1951. }
  1952. }
  1953. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  1954. {
  1955. if (_singletonScript.RoundTrump == "Spades")
  1956. {
  1957. _singletonScript.SecondCardCenterRanking("Trump");
  1958. }
  1959. else
  1960. {
  1961. _singletonScript.SecondCardCenterRanking("Spades");
  1962. }
  1963. }
  1964. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  1965. {
  1966. if (_singletonScript.RoundTrump == "Hearts")
  1967. {
  1968. _singletonScript.SecondCardCenterRanking("Trump");
  1969. }
  1970. else
  1971. {
  1972. _singletonScript.SecondCardCenterRanking("Hearts");
  1973. }
  1974. }
  1975. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  1976. {
  1977. if (_singletonScript.RoundTrump == "Diamonds")
  1978. {
  1979. _singletonScript.SecondCardCenterRanking("Trump");
  1980. }
  1981. else
  1982. {
  1983. _singletonScript.SecondCardCenterRanking("Diamonds");
  1984. }
  1985. }
  1986. if (value == "17" || value == "18" || value == "19" || value == "20")
  1987. {
  1988. _singletonScript.SecondCardCenterRanking("Trump");
  1989. }
  1990. }
  1991. if (nam == 3)
  1992. {
  1993. center = CenterPoint04;
  1994. cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  1995. cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
  1996. _singletonScript.arr[2] = cardCenterSpawn[2];
  1997. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  1998. {
  1999. if (_singletonScript.RoundTrump == "Clubs")
  2000. {
  2001. _singletonScript.ThirdCardCenterRanking("Trump");
  2002. }
  2003. else
  2004. {
  2005. _singletonScript.ThirdCardCenterRanking("Clubs");
  2006. }
  2007. }
  2008. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  2009. {
  2010. if (_singletonScript.RoundTrump == "Spades")
  2011. {
  2012. _singletonScript.ThirdCardCenterRanking("Trump");
  2013. }
  2014. else
  2015. {
  2016. _singletonScript.ThirdCardCenterRanking("Spades");
  2017. }
  2018. }
  2019. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  2020. {
  2021. if (_singletonScript.RoundTrump == "Hearts")
  2022. {
  2023. _singletonScript.ThirdCardCenterRanking("Trump");
  2024. }
  2025. else
  2026. {
  2027. _singletonScript.ThirdCardCenterRanking("Hearts");
  2028. }
  2029. }
  2030. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  2031. {
  2032. if (_singletonScript.RoundTrump == "Diamonds")
  2033. {
  2034. _singletonScript.ThirdCardCenterRanking("Trump");
  2035. }
  2036. else
  2037. {
  2038. _singletonScript.ThirdCardCenterRanking("Diamonds");
  2039. }
  2040. }
  2041. if (value == "17" || value == "18" || value == "19" || value == "20")
  2042. {
  2043. _singletonScript.ThirdCardCenterRanking("Trump");
  2044. }
  2045. }
  2046. if (nam == 4)
  2047. {
  2048. center = CenterPoint01;
  2049. cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
  2050. cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
  2051. _singletonScript.arr[3] = cardCenterSpawn[3];
  2052. if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
  2053. {
  2054. if (_singletonScript.RoundTrump == "Clubs")
  2055. {
  2056. _singletonScript.FourthCardCenterRanking("Trump");
  2057. }
  2058. else
  2059. {
  2060. _singletonScript.FourthCardCenterRanking("Clubs");
  2061. }
  2062. }
  2063. if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
  2064. {
  2065. if (_singletonScript.RoundTrump == "Spades")
  2066. {
  2067. _singletonScript.FourthCardCenterRanking("Trump");
  2068. }
  2069. else
  2070. {
  2071. _singletonScript.FourthCardCenterRanking("Spades");
  2072. }
  2073. }
  2074. if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
  2075. {
  2076. if (_singletonScript.RoundTrump == "Hearts")
  2077. {
  2078. _singletonScript.FourthCardCenterRanking("Trump");
  2079. }
  2080. else
  2081. {
  2082. _singletonScript.FourthCardCenterRanking("Hearts");
  2083. }
  2084. }
  2085. if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
  2086. {
  2087. if (_singletonScript.RoundTrump == "Diamonds")
  2088. {
  2089. _singletonScript.FourthCardCenterRanking("Trump");
  2090. }
  2091. else
  2092. {
  2093. _singletonScript.FourthCardCenterRanking("Diamonds");
  2094. }
  2095. }
  2096. if (value == "17" || value == "18" || value == "19" || value == "20")
  2097. {
  2098. _singletonScript.FourthCardCenterRanking("Trump");
  2099. }
  2100. }
  2101. }
  2102. }
  2103.  
  2104. // ------- Определение первого игрока в раздаче -------
  2105. [Command]
  2106. public void CmdWhoFirst(int value)
  2107. {
  2108. RpcWhoFirst(value);
  2109. }
  2110. [ClientRpc]
  2111. public void RpcWhoFirst(int value)
  2112. {
  2113. if (value == 1)
  2114. {
  2115. if (_singletonScript.FirstSpawnCards == true)
  2116. {
  2117. _singletonScript.cardTrump01("Clubs");
  2118. _singletonScript.cardTrump02("Diamonds");
  2119. _singletonScript.cardTrump03("Spades");
  2120. _singletonScript.cardTrump04("Hearts");
  2121.  
  2122. _singletonScript.RoundTrumping("Clubs");
  2123.  
  2124. _singletonScript.FirstSpawnCards = false;
  2125. }
  2126. else
  2127. {
  2128. _singletonScript.RoundTrumping(_singletonScript.CardTrump01);
  2129. }
  2130. }
  2131. if (value == 2)
  2132. {
  2133. if (_singletonScript.FirstSpawnCards == true)
  2134. {
  2135. _singletonScript.cardTrump01("Hearts");
  2136. _singletonScript.cardTrump02("Clubs");
  2137. _singletonScript.cardTrump03("Diamonds");
  2138. _singletonScript.cardTrump04("Spades");
  2139.  
  2140. _singletonScript.RoundTrumping("Clubs");
  2141.  
  2142. _singletonScript.FirstSpawnCards = false;
  2143. }
  2144. else
  2145. {
  2146. _singletonScript.RoundTrumping(_singletonScript.CardTrump02);
  2147. }
  2148. }
  2149. if (value == 3)
  2150. {
  2151. if (_singletonScript.FirstSpawnCards == true)
  2152. {
  2153. _singletonScript.cardTrump01("Spades");
  2154. _singletonScript.cardTrump02("Hearts");
  2155. _singletonScript.cardTrump03("Clubs");
  2156. _singletonScript.cardTrump04("Dimonds");
  2157.  
  2158. _singletonScript.RoundTrumping("Clubs");
  2159.  
  2160. _singletonScript.FirstSpawnCards = false;
  2161. }
  2162. else
  2163. {
  2164. _singletonScript.RoundTrumping(_singletonScript.CardTrump03);
  2165. }
  2166.  
  2167. }
  2168. if (value == 4)
  2169. {
  2170. if (_singletonScript.FirstSpawnCards == true)
  2171. {
  2172. _singletonScript.cardTrump01("Diamonds");
  2173. _singletonScript.cardTrump02("Spades");
  2174. _singletonScript.cardTrump03("Hearts");
  2175. _singletonScript.cardTrump04("Clubs");
  2176.  
  2177. _singletonScript.RoundTrumping("Clubs");
  2178.  
  2179. _singletonScript.FirstSpawnCards = false;
  2180. }
  2181. else
  2182. {
  2183. _singletonScript.RoundTrumping(_singletonScript.CardTrump04);
  2184. }
  2185. }
  2186.  
  2187. if (_singletonScript.FirstSpawnCards == false)
  2188. {
  2189. if (_singletonScript.roundCounter == 1)
  2190. {
  2191. _singletonScript.playerMass[0] = _singletonScript.pName01;
  2192. _singletonScript.playerMass[1] = _singletonScript.pName02;
  2193. _singletonScript.playerMass[2] = _singletonScript.pName03;
  2194. _singletonScript.playerMass[3] = _singletonScript.pName04;
  2195. }
  2196. else if (_singletonScript.roundCounter == 2)
  2197. {
  2198. _singletonScript.playerMass[0] = _singletonScript.pName02;
  2199. _singletonScript.playerMass[1] = _singletonScript.pName03;
  2200. _singletonScript.playerMass[2] = _singletonScript.pName04;
  2201. _singletonScript.playerMass[3] = _singletonScript.pName01;
  2202. }
  2203. else if (_singletonScript.roundCounter == 3)
  2204. {
  2205. _singletonScript.playerMass[0] = _singletonScript.pName03;
  2206. _singletonScript.playerMass[1] = _singletonScript.pName04;
  2207. _singletonScript.playerMass[2] = _singletonScript.pName01;
  2208. _singletonScript.playerMass[3] = _singletonScript.pName02;
  2209. }
  2210. else if (_singletonScript.roundCounter == 4)
  2211. {
  2212. _singletonScript.playerMass[0] = _singletonScript.pName04;
  2213. _singletonScript.playerMass[1] = _singletonScript.pName01;
  2214. _singletonScript.playerMass[2] = _singletonScript.pName02;
  2215. _singletonScript.playerMass[3] = _singletonScript.pName03;
  2216. }
  2217. else if (_singletonScript.roundCounter == 5)
  2218. {
  2219. _singletonScript.playerMass[0] = _singletonScript.pName01;
  2220. _singletonScript.playerMass[1] = _singletonScript.pName02;
  2221. _singletonScript.playerMass[2] = _singletonScript.pName03;
  2222. _singletonScript.playerMass[3] = _singletonScript.pName04;
  2223. }
  2224. else if (_singletonScript.roundCounter == 6)
  2225. {
  2226. _singletonScript.playerMass[0] = _singletonScript.pName02;
  2227. _singletonScript.playerMass[1] = _singletonScript.pName03;
  2228. _singletonScript.playerMass[2] = _singletonScript.pName04;
  2229. _singletonScript.playerMass[3] = _singletonScript.pName01;
  2230. }
  2231. else if (_singletonScript.roundCounter == 7)
  2232. {
  2233. _singletonScript.playerMass[0] = _singletonScript.pName03;
  2234. _singletonScript.playerMass[1] = _singletonScript.pName04;
  2235. _singletonScript.playerMass[2] = _singletonScript.pName01;
  2236. _singletonScript.playerMass[3] = _singletonScript.pName02;
  2237. }
  2238. else if (_singletonScript.roundCounter == 8)
  2239. {
  2240. _singletonScript.playerMass[0] = _singletonScript.pName04;
  2241. _singletonScript.playerMass[1] = _singletonScript.pName01;
  2242. _singletonScript.playerMass[2] = _singletonScript.pName02;
  2243. _singletonScript.playerMass[3] = _singletonScript.pName03;
  2244.  
  2245. _singletonScript.roundCounter = 1;
  2246. }
  2247. }
  2248. }
  2249.  
  2250. // ------- Создание карт на игровом поле -------
  2251. public void CardRecieve(int[] go)
  2252. {
  2253. if (_singletonScript.playerMass[0] == _singletonScript._yourName)
  2254. {
  2255. card01 = Instantiate(Resources.Load(go[0].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
  2256. card01.GetComponent<CardScript>().C = 0;
  2257. card01.GetComponent<CardScript>().cardName = go[0].ToString();
  2258. card01.GetComponent<CardScript>().Player = gameObject;
  2259.  
  2260. card02 = Instantiate(Resources.Load(go[1].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
  2261. card02.GetComponent<CardScript>().C = 1;
  2262. card02.GetComponent<CardScript>().cardName = go[1].ToString();
  2263. card02.GetComponent<CardScript>().Player = gameObject;
  2264.  
  2265. card03 = Instantiate(Resources.Load(go[2].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
  2266. card03.GetComponent<CardScript>().C = 2;
  2267. card03.GetComponent<CardScript>().cardName = go[2].ToString();
  2268. card03.GetComponent<CardScript>().Player = gameObject;
  2269.  
  2270. card04 = Instantiate(Resources.Load(go[3].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
  2271. card04.GetComponent<CardScript>().C = 3;
  2272. card04.GetComponent<CardScript>().cardName = go[3].ToString();
  2273. card04.GetComponent<CardScript>().Player = gameObject;
  2274.  
  2275. card05 = Instantiate(Resources.Load(go[4].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
  2276. card05.GetComponent<CardScript>().C = 4;
  2277. card05.GetComponent<CardScript>().cardName = go[4].ToString();
  2278. card05.GetComponent<CardScript>().Player = gameObject;
  2279.  
  2280. card06 = Instantiate(Resources.Load(go[5].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
  2281. card06.GetComponent<CardScript>().C = 5;
  2282. card06.GetComponent<CardScript>().cardName = go[5].ToString();
  2283. card06.GetComponent<CardScript>().Player = gameObject;
  2284.  
  2285. card07 = Instantiate(Resources.Load(go[6].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
  2286. card07.GetComponent<CardScript>().C = 6;
  2287. card07.GetComponent<CardScript>().cardName = go[6].ToString();
  2288. card07.GetComponent<CardScript>().Player = gameObject;
  2289.  
  2290. card08 = Instantiate(Resources.Load(go[7].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
  2291. card08.GetComponent<CardScript>().C = 7;
  2292. card08.GetComponent<CardScript>().cardName = go[7].ToString();
  2293. card08.GetComponent<CardScript>().Player = gameObject;
  2294. if (card01.name == "17(Clone)" || card02.name == "17(Clone)" || card03.name == "17(Clone)" || card04.name == "17(Clone)" || card05.name == "17(Clone)" || card06.name == "17(Clone)" || card07.name == "17(Clone)" || card08.name == "17(Clone)")
  2295. {
  2296. if (_singletonScript.pName01 == _singletonScript._yourName)
  2297. {
  2298. CmdWhoFirst(1);
  2299. }
  2300. else if (_singletonScript.pName02 == _singletonScript._yourName)
  2301. {
  2302. CmdWhoFirst(2);
  2303. }
  2304. else if (_singletonScript.pName03 == _singletonScript._yourName)
  2305. {
  2306. CmdWhoFirst(3);
  2307. }
  2308. else if (_singletonScript.pName04 == _singletonScript._yourName)
  2309. {
  2310. CmdWhoFirst(4);
  2311. }
  2312. }
  2313. }
  2314. if (_singletonScript.playerMass[1] == _singletonScript._yourName)
  2315. {
  2316. card01 = Instantiate(Resources.Load(go[8].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
  2317. card01.GetComponent<CardScript>().C = 8;
  2318. card01.GetComponent<CardScript>().cardName = go[8].ToString();
  2319. card01.GetComponent<CardScript>().Player = gameObject;
  2320.  
  2321. card02 = Instantiate(Resources.Load(go[9].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
  2322. card02.GetComponent<CardScript>().C = 9;
  2323. card02.GetComponent<CardScript>().cardName = go[9].ToString();
  2324. card02.GetComponent<CardScript>().Player = gameObject;
  2325.  
  2326. card03 = Instantiate(Resources.Load(go[10].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
  2327. card03.GetComponent<CardScript>().C = 10;
  2328. card03.GetComponent<CardScript>().cardName = go[10].ToString();
  2329. card03.GetComponent<CardScript>().Player = gameObject;
  2330.  
  2331. card04 = Instantiate(Resources.Load(go[11].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
  2332. card04.GetComponent<CardScript>().C = 11;
  2333. card04.GetComponent<CardScript>().cardName = go[11].ToString();
  2334. card04.GetComponent<CardScript>().Player = gameObject;
  2335.  
  2336. card05 = Instantiate(Resources.Load(go[12].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
  2337. card05.GetComponent<CardScript>().C = 12;
  2338. card05.GetComponent<CardScript>().cardName = go[12].ToString();
  2339. card05.GetComponent<CardScript>().Player = gameObject;
  2340.  
  2341. card06 = Instantiate(Resources.Load(go[13].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
  2342. card06.GetComponent<CardScript>().C = 13;
  2343. card06.GetComponent<CardScript>().cardName = go[13].ToString();
  2344. card06.GetComponent<CardScript>().Player = gameObject;
  2345.  
  2346. card07 = Instantiate(Resources.Load(go[14].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
  2347. card07.GetComponent<CardScript>().C = 14;
  2348. card07.GetComponent<CardScript>().cardName = go[14].ToString();
  2349. card07.GetComponent<CardScript>().Player = gameObject;
  2350.  
  2351. card08 = Instantiate(Resources.Load(go[15].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
  2352. card08.GetComponent<CardScript>().C = 15;
  2353. card08.GetComponent<CardScript>().cardName = go[15].ToString();
  2354. card08.GetComponent<CardScript>().Player = gameObject;
  2355. if (card01.name == "17(Clone)" || card02.name == "17(Clone)" || card03.name == "17(Clone)" || card04.name == "17(Clone)" || card05.name == "17(Clone)" || card06.name == "17(Clone)" || card07.name == "17(Clone)" || card08.name == "17(Clone)")
  2356. {
  2357. if (_singletonScript.pName01 == _singletonScript._yourName)
  2358. {
  2359. CmdWhoFirst(1);
  2360. }
  2361. else if (_singletonScript.pName02 == _singletonScript._yourName)
  2362. {
  2363. CmdWhoFirst(2);
  2364. }
  2365. else if (_singletonScript.pName03 == _singletonScript._yourName)
  2366. {
  2367. CmdWhoFirst(3);
  2368. }
  2369. else if (_singletonScript.pName04 == _singletonScript._yourName)
  2370. {
  2371. CmdWhoFirst(4);
  2372. }
  2373. }
  2374. }
  2375. if (_singletonScript.playerMass[2] == _singletonScript._yourName)
  2376. {
  2377. card01 = Instantiate(Resources.Load(go[16].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
  2378. card01.GetComponent<CardScript>().C = 16;
  2379. card01.GetComponent<CardScript>().cardName = go[16].ToString();
  2380. card01.GetComponent<CardScript>().Player = gameObject;
  2381.  
  2382. card02 = Instantiate(Resources.Load(go[17].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
  2383. card02.GetComponent<CardScript>().C = 17;
  2384. card02.GetComponent<CardScript>().cardName = go[17].ToString();
  2385. card02.GetComponent<CardScript>().Player = gameObject;
  2386.  
  2387. card03 = Instantiate(Resources.Load(go[18].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
  2388. card03.GetComponent<CardScript>().C = 18;
  2389. card03.GetComponent<CardScript>().cardName = go[18].ToString();
  2390. card03.GetComponent<CardScript>().Player = gameObject;
  2391.  
  2392. card04 = Instantiate(Resources.Load(go[19].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
  2393. card04.GetComponent<CardScript>().C = 19;
  2394. card04.GetComponent<CardScript>().cardName = go[19].ToString();
  2395. card04.GetComponent<CardScript>().Player = gameObject;
  2396.  
  2397. card05 = Instantiate(Resources.Load(go[20].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
  2398. card05.GetComponent<CardScript>().C = 20;
  2399. card05.GetComponent<CardScript>().cardName = go[20].ToString();
  2400. card05.GetComponent<CardScript>().Player = gameObject;
  2401.  
  2402. card06 = Instantiate(Resources.Load(go[21].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
  2403. card06.GetComponent<CardScript>().C = 21;
  2404. card06.GetComponent<CardScript>().cardName = go[21].ToString();
  2405. card06.GetComponent<CardScript>().Player = gameObject;
  2406.  
  2407. card07 = Instantiate(Resources.Load(go[22].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
  2408. card07.GetComponent<CardScript>().C = 22;
  2409. card07.GetComponent<CardScript>().cardName = go[22].ToString();
  2410. card07.GetComponent<CardScript>().Player = gameObject;
  2411.  
  2412. card08 = Instantiate(Resources.Load(go[23].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
  2413. card08.GetComponent<CardScript>().C = 23;
  2414. card08.GetComponent<CardScript>().cardName = go[23].ToString();
  2415. card08.GetComponent<CardScript>().Player = gameObject;
  2416. if (card01.name == "17(Clone)" || card02.name == "17(Clone)" || card03.name == "17(Clone)" || card04.name == "17(Clone)" || card05.name == "17(Clone)" || card06.name == "17(Clone)" || card07.name == "17(Clone)" || card08.name == "17(Clone)")
  2417. {
  2418. if (_singletonScript.pName01 == _singletonScript._yourName)
  2419. {
  2420. CmdWhoFirst(1);
  2421. }
  2422. else if (_singletonScript.pName02 == _singletonScript._yourName)
  2423. {
  2424. CmdWhoFirst(2);
  2425. }
  2426. else if (_singletonScript.pName03 == _singletonScript._yourName)
  2427. {
  2428. CmdWhoFirst(3);
  2429. }
  2430. else if (_singletonScript.pName04 == _singletonScript._yourName)
  2431. {
  2432. CmdWhoFirst(4);
  2433. }
  2434. }
  2435. }
  2436. if (_singletonScript.playerMass[3] == _singletonScript._yourName)
  2437. {
  2438. card01 = Instantiate(Resources.Load(go[24].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
  2439. card01.GetComponent<CardScript>().C = 24;
  2440. card01.GetComponent<CardScript>().cardName = go[24].ToString();
  2441. card01.GetComponent<CardScript>().Player = gameObject;
  2442.  
  2443. card02 = Instantiate(Resources.Load(go[25].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
  2444. card02.GetComponent<CardScript>().C = 25;
  2445. card02.GetComponent<CardScript>().cardName = go[25].ToString();
  2446. card02.GetComponent<CardScript>().Player = gameObject;
  2447.  
  2448. card03 = Instantiate(Resources.Load(go[26].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
  2449. card03.GetComponent<CardScript>().C = 26;
  2450. card03.GetComponent<CardScript>().cardName = go[26].ToString();
  2451. card03.GetComponent<CardScript>().Player = gameObject;
  2452.  
  2453. card04 = Instantiate(Resources.Load(go[27].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
  2454. card04.GetComponent<CardScript>().C = 27;
  2455. card04.GetComponent<CardScript>().cardName = go[27].ToString();
  2456. card04.GetComponent<CardScript>().Player = gameObject;
  2457.  
  2458. card05 = Instantiate(Resources.Load(go[28].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
  2459. card05.GetComponent<CardScript>().C = 28;
  2460. card05.GetComponent<CardScript>().cardName = go[28].ToString();
  2461. card05.GetComponent<CardScript>().Player = gameObject;
  2462.  
  2463. card06 = Instantiate(Resources.Load(go[29].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
  2464. card06.GetComponent<CardScript>().C = 29;
  2465. card06.GetComponent<CardScript>().cardName = go[29].ToString();
  2466. card06.GetComponent<CardScript>().Player = gameObject;
  2467.  
  2468. card07 = Instantiate(Resources.Load(go[30].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
  2469. card07.GetComponent<CardScript>().C = 30;
  2470. card07.GetComponent<CardScript>().cardName = go[30].ToString();
  2471. card07.GetComponent<CardScript>().Player = gameObject;
  2472.  
  2473. card08 = Instantiate(Resources.Load(go[31].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
  2474. card08.GetComponent<CardScript>().C = 31;
  2475. card08.GetComponent<CardScript>().cardName = go[31].ToString();
  2476. card08.GetComponent<CardScript>().Player = gameObject;
  2477. if (card01.name == "17(Clone)" || card02.name == "17(Clone)" || card03.name == "17(Clone)" || card04.name == "17(Clone)" || card05.name == "17(Clone)" || card06.name == "17(Clone)" || card07.name == "17(Clone)" || card08.name == "17(Clone)")
  2478. {
  2479. if (_singletonScript.pName01 == _singletonScript._yourName)
  2480. {
  2481. CmdWhoFirst(1);
  2482. }
  2483. else if (_singletonScript.pName02 == _singletonScript._yourName)
  2484. {
  2485. CmdWhoFirst(2);
  2486. }
  2487. else if (_singletonScript.pName03 == _singletonScript._yourName)
  2488. {
  2489. CmdWhoFirst(3);
  2490. }
  2491. else if (_singletonScript.pName04 == _singletonScript._yourName)
  2492. {
  2493. CmdWhoFirst(4);
  2494. }
  2495. }
  2496. }
  2497.  
  2498. _singletonScript.ScoreTeamOne = 0;
  2499. _singletonScript.ScoreTeamTwo = 0;
  2500. }
  2501. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement