Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.Networking;
- using UnityEngine.Networking.Types;
- using UnityEngine.Networking.Match;
- public class Player : NetworkBehaviour
- {
- private GameObject spawnSpot01;
- private GameObject spawnSpot02;
- private GameObject spawnSpot03;
- private GameObject spawnSpot04;
- private GameObject spawnSpot05;
- private GameObject spawnSpot06;
- private GameObject spawnSpot07;
- private GameObject spawnSpot08;
- private GameObject CenterPoint01;
- private GameObject CenterPoint02;
- private GameObject CenterPoint03;
- private GameObject CenterPoint04;
- private GameObject center;
- public GameObject card01;
- public GameObject card02;
- public GameObject card03;
- public GameObject card04;
- public GameObject card05;
- public GameObject card06;
- public GameObject card07;
- public GameObject card08;
- public GameObject[] cardCenterSpawn;
- public int[] cards = new int[32];
- public GameObject Card;
- public CardScript cardScript;
- public GameObject _game;
- public Game _gameScript;
- public GameObject _text;
- public Text TextTest;
- public GameObject _textScore01;
- public Text scoreText01;
- public GameObject _textScore02;
- public Text scoreText02;
- public GameObject _textGameScore01;
- public Text gameScoreText01;
- public GameObject _textGameScore02;
- public Text gameScoreText02;
- public GameObject _singleton;
- public Singleton _singletonScript;
- public GameObject lobbyManager;
- public NetworkLobbyManager lm;
- public GameObject gameMaster;
- public string CAT;
- [SyncVar]
- public string Status = "";
- public string[] playerNames = new string[4];
- public bool isCardTouched = false;
- public string centerCardName;
- public int num;
- public int stopper;
- public string turn;
- public bool canTurn;
- public bool firstRound = true;
- public GameObject yourNumber;
- private void Awake()
- {
- _text = GameObject.FindGameObjectWithTag("text");
- }
- void Start ()
- {
- spawnSpot01 = GameObject.FindWithTag("sp01");
- spawnSpot02 = GameObject.FindWithTag("sp02");
- spawnSpot03 = GameObject.FindWithTag("sp03");
- spawnSpot04 = GameObject.FindWithTag("sp04");
- spawnSpot05 = GameObject.FindWithTag("sp05");
- spawnSpot06 = GameObject.FindWithTag("sp06");
- spawnSpot07 = GameObject.FindWithTag("sp07");
- spawnSpot08 = GameObject.FindWithTag("sp08");
- CenterPoint01 = GameObject.FindGameObjectWithTag("CenterPoint01");
- CenterPoint02 = GameObject.FindGameObjectWithTag("CenterPoint02");
- CenterPoint03 = GameObject.FindGameObjectWithTag("CenterPoint03");
- CenterPoint04 = GameObject.FindGameObjectWithTag("CenterPoint04");
- _singleton = GameObject.Find("SINGLETON");
- _singletonScript = _singleton.GetComponent<Singleton>();
- cardCenterSpawn = new GameObject[4];
- canTurn = true;
- stopper = 0;
- CAT = _singletonScript._yourName;
- if (isLocalPlayer)
- {
- }
- lobbyManager = GameObject.Find("LobbyManager");
- lm = lobbyManager.GetComponent<NetworkLobbyManager>();
- gameMaster = GameObject.Find("GameMaster");
- }
- [Command]
- void CmdStatusFunc(string st)
- {
- Status = st;
- }
- public int a = 0;
- void Update()
- {
- if (isLocalPlayer)
- {
- yourNumber = GameObject.FindGameObjectWithTag("YourNumber");
- if (yourNumber != null)
- {
- Text numText = yourNumber.GetComponent<Text>();
- if (_singletonScript.playerMass[0] == _singletonScript._yourName)
- {
- numText.text = "Ты первый";
- }
- if (_singletonScript.playerMass[1] == _singletonScript._yourName)
- {
- numText.text = "Ты второй";
- }
- if (_singletonScript.playerMass[2] == _singletonScript._yourName)
- {
- numText.text = "Ты третий";
- }
- if (_singletonScript.playerMass[3] == _singletonScript._yourName)
- {
- numText.text = "Ты четвертый";
- }
- }
- if (_singletonScript.playerMass[0] == _singletonScript._yourName && _singletonScript.Turn == "First" && stopper == 0)
- {
- if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
- {
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 1)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 1)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 1)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 1)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 1)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 1)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 1)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 1)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 2)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 2)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 2)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 2)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 2)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 2)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 2)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 2)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- }
- }
- if (_singletonScript.playerMass[1] == _singletonScript._yourName && _singletonScript.Turn == "Second" && stopper == 0)
- {
- if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
- {
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 1)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 1)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 1)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 1)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 1)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 1)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 1)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 1)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 2)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 2)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 2)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 2)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 2)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 2)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 2)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 2)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 3)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 3)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 3)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 3)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 3)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 3)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 3)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 3)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- }
- }
- if (_singletonScript.playerMass[2] == _singletonScript._yourName && _singletonScript.Turn == "Third" && stopper == 0)
- {
- if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
- {
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 1)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 1)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 1)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 1)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 1)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 1)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 1)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 1)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 2)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 2)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 2)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 2)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 2)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 2)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 2)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 2)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 3)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 3)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 3)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 3)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 3)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 3)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 3)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 3)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- }
- }
- if (_singletonScript.playerMass[3] == _singletonScript._yourName && _singletonScript.Turn == "Fourth")
- {
- if (card01 != null && card02 != null && card03 != null && card04 != null && card05 != null && card06 != null && card07 != null && card08 != null)
- {
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 1 && stopper == 0)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 2 && stopper == 0)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- 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)
- {
- if (card01.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card01.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card01.GetComponent<CardScript>().isPossible = false;
- }
- if (card02.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card02.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card02.GetComponent<CardScript>().isPossible = false;
- }
- if (card03.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card03.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card03.GetComponent<CardScript>().isPossible = false;
- }
- if (card04.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card04.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card04.GetComponent<CardScript>().isPossible = false;
- }
- if (card05.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card05.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card05.GetComponent<CardScript>().isPossible = false;
- }
- if (card06.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card06.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card06.GetComponent<CardScript>().isPossible = false;
- }
- if (card07.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card07.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card07.GetComponent<CardScript>().isPossible = false;
- }
- if (card08.GetComponent<CardScript>().whichCard == 3 && stopper == 0)
- {
- card08.GetComponent<CardScript>().isPossible = true;
- }
- else
- {
- card08.GetComponent<CardScript>().isPossible = false;
- }
- }
- }
- }
- _game = GameObject.FindGameObjectWithTag("Game");
- _text = GameObject.FindGameObjectWithTag("text");
- _textScore01 = GameObject.FindGameObjectWithTag("TextScore01");
- _textScore02 = GameObject.FindGameObjectWithTag("TextScore02");
- if (_singletonScript.isScore == true)
- {
- scoreText01 = _textScore01.GetComponent<Text>();
- scoreText01.text = "Team One Score: " + _singletonScript.ScoreTeamOne.ToString();
- scoreText02 = _textScore02.GetComponent<Text>();
- scoreText02.text = "Team Two Score: " + _singletonScript.ScoreTeamTwo.ToString();
- _singletonScript.isScore = false;
- }
- if (_game != null)
- {
- _gameScript = _game.GetComponent<Game>();
- }
- if (_singletonScript.NewRound == true)
- {
- CmdCardShuffle();
- StartCoroutine(WaitAndRecieve());
- turn = "First";
- CmdTurner("First");
- _singletonScript.NewRound = false;
- }
- if (isCardTouched == true)
- {
- if (num == 1)
- {
- CmdTurner("Second");
- CmdCenterSpawner(centerCardName, num);
- turn = "Second";
- num = 0;
- }
- else if (num == 2)
- {
- CmdTurner("Third");
- CmdCenterSpawner(centerCardName, num);
- turn = "Third";
- num = 0;
- }
- else if (num == 3)
- {
- CmdTurner("Fourth");
- CmdCenterSpawner(centerCardName, num);
- turn = "Fourth";
- num = 0;
- }
- else if (num == 4)
- {
- CmdCenterSpawner(centerCardName, num);
- StartCoroutine(WaitAndDelete());
- turn = "First";
- num = 0;
- }
- isCardTouched = false;
- StartCoroutine(WaitAndStopper());
- }
- if (Input.GetKeyDown(KeyCode.A))
- {
- }
- }
- }
- public IEnumerator WaitAndMrCat()
- {
- yield return new WaitForSeconds(0.7f);
- CmdMrCat();
- }
- [Command]
- public void CmdMrCat()
- {
- RpcMrCat();
- }
- [ClientRpc]
- public void RpcMrCat()
- {
- if (_singletonScript.CardRanks[1] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[1] > _singletonScript.CardRanks[2] && _singletonScript.CardRanks[1] > _singletonScript.CardRanks[3])
- {
- string temp = _singletonScript.playerMass[0];
- _singletonScript.playerMass[0] = _singletonScript.playerMass[1];
- _singletonScript.playerMass[1] = _singletonScript.playerMass[2];
- _singletonScript.playerMass[2] = _singletonScript.playerMass[3];
- _singletonScript.playerMass[3] = temp;
- }
- else if (_singletonScript.CardRanks[2] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[2] > _singletonScript.CardRanks[1] && _singletonScript.CardRanks[2] > _singletonScript.CardRanks[3])
- {
- string temp = _singletonScript.playerMass[0];
- _singletonScript.playerMass[0] = _singletonScript.playerMass[2];
- string temp2 = _singletonScript.playerMass[1];
- _singletonScript.playerMass[1] = _singletonScript.playerMass[3];
- _singletonScript.playerMass[2] = temp;
- _singletonScript.playerMass[3] = temp2;
- }
- else if (_singletonScript.CardRanks[3] > _singletonScript.CardRanks[0] && _singletonScript.CardRanks[3] > _singletonScript.CardRanks[1] && _singletonScript.CardRanks[3] > _singletonScript.CardRanks[2])
- {
- string temp = _singletonScript.playerMass[0];
- _singletonScript.playerMass[0] = _singletonScript.playerMass[3];
- string temp2 = _singletonScript.playerMass[1];
- _singletonScript.playerMass[1] = temp;
- string temp3 = _singletonScript.playerMass[2];
- _singletonScript.playerMass[2] = temp2;
- _singletonScript.playerMass[3] = temp3;
- }
- }
- public IEnumerator WaitAndStopper()
- {
- yield return new WaitForSeconds(0.7f);
- stopper = 0;
- }
- public IEnumerator WaitAndRecieve()
- {
- yield return new WaitForSeconds(1f);
- CardRecieve(_singletonScript.cards);
- }
- public GameObject cat;
- public int i = 0;
- // ------- Рандомное перемешивание карт -------
- [Command]
- void CmdCardShuffle()
- {
- int[] cardsArr = new int[32];
- for (int i = 0; i < 32; i++)
- {
- cardsArr[i] = i + 1;
- }
- for (int i = 31; i >= 0; i--)
- {
- int j = Random.Range(0, i + 1);
- int temp = cardsArr[j];
- cardsArr[j] = cardsArr[i];
- cardsArr[i] = temp;
- RpcCardShuffle(i, cardsArr[i]);
- }
- }
- [ClientRpc]
- void RpcCardShuffle(int i,int value)
- {
- _singletonScript.cards[i] = value;
- }
- // ------- Удаление кард после хода 4 игрока -------
- public IEnumerator WaitAndDelete()
- {
- yield return new WaitForSeconds(0.5f);
- CmdMrCat();
- CmdCenterRemover();
- CmdTurner("First");
- }
- [Command]
- public void CmdCenterRemover()
- {
- RpcCenterRemover();
- }
- [ClientRpc]
- public void RpcCenterRemover()
- {
- for (int i = 0; i < 4; i++)
- {
- Destroy(_singletonScript.arr[i]);
- }
- }
- // ------- Смена хода игроков -------
- [Command]
- public void CmdTurner(string text)
- {
- RpcTurner(text);
- }
- [ClientRpc]
- public void RpcTurner(string text)
- {
- _singletonScript.turner(text);
- }
- // ------- Рандом -------
- [Command]
- public void CmdRandom()
- {
- int rand = Random.Range(0, 100);
- RpcRandom(rand);
- }
- [ClientRpc]
- public void RpcRandom(int value)
- {
- _singletonScript.RANDOMSYNC = value;
- }
- // ------- Спавн карт в центре стола у всех игроков с заданными параметрами -------
- [Command]
- public void CmdCenterSpawner(string value, int nam)
- {
- RpcCenterSpawner(value, nam);
- }
- [ClientRpc]
- public void RpcCenterSpawner(string value, int nam)
- {
- if (_singletonScript.playerMass[0] == _singletonScript._yourName)
- {
- if (nam == 1)
- {
- center = CenterPoint01;
- cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[0] = cardCenterSpawn[0];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- }
- if (nam == 2)
- {
- center = CenterPoint02;
- cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[1] = cardCenterSpawn[1];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- }
- if (nam == 3)
- {
- center = CenterPoint03;
- cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[2] = cardCenterSpawn[2];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- }
- if (nam == 4)
- {
- center = CenterPoint04;
- cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[3] = cardCenterSpawn[3];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- }
- }
- if (_singletonScript.playerMass[1] == _singletonScript._yourName)
- {
- if (nam == 1)
- {
- center = CenterPoint04;
- cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[0] = cardCenterSpawn[0];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- }
- if (nam == 2)
- {
- center = CenterPoint01;
- cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[1] = cardCenterSpawn[1];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- }
- if (nam == 3)
- {
- center = CenterPoint02;
- cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[2] = cardCenterSpawn[2];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- }
- if (nam == 4)
- {
- center = CenterPoint03;
- cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[3] = cardCenterSpawn[3];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- }
- }
- if (_singletonScript.playerMass[2] == _singletonScript._yourName)
- {
- if (nam == 1)
- {
- center = CenterPoint03;
- cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[0] = cardCenterSpawn[0];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- }
- if (nam == 2)
- {
- center = CenterPoint04;
- cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[1] = cardCenterSpawn[1];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- }
- if (nam == 3)
- {
- center = CenterPoint01;
- cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[2] = cardCenterSpawn[2];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- }
- if (nam == 4)
- {
- center = CenterPoint02;
- cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[3] = cardCenterSpawn[3];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- }
- }
- if (_singletonScript.playerMass[3] == _singletonScript._yourName)
- {
- if (nam == 1)
- {
- center = CenterPoint02;
- cardCenterSpawn[0] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[0].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[0] = cardCenterSpawn[0];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FirstCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FirstCardCenterRanking("Trump");
- }
- }
- if (nam == 2)
- {
- center = CenterPoint03;
- cardCenterSpawn[1] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[1].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[1] = cardCenterSpawn[1];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.SecondCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.SecondCardCenterRanking("Trump");
- }
- }
- if (nam == 3)
- {
- center = CenterPoint04;
- cardCenterSpawn[2] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[2].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[2] = cardCenterSpawn[2];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.ThirdCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.ThirdCardCenterRanking("Trump");
- }
- }
- if (nam == 4)
- {
- center = CenterPoint01;
- cardCenterSpawn[3] = Instantiate(Resources.Load(value), center.transform.position, center.transform.rotation) as GameObject;
- cardCenterSpawn[3].GetComponent<CardScript>().spawnedCard = true;
- _singletonScript.arr[3] = cardCenterSpawn[3];
- if (value == "1" || value == "5" || value == "9" || value == "13" || value == "21" || value == "25" || value == "29")
- {
- if (_singletonScript.RoundTrump == "Clubs")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Clubs");
- }
- }
- if (value == "4" || value == "8" || value == "12" || value == "16" || value == "24" || value == "28" || value == "32")
- {
- if (_singletonScript.RoundTrump == "Spades")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Spades");
- }
- }
- if (value == "3" || value == "7" || value == "11" || value == "15" || value == "23" || value == "27" || value == "31")
- {
- if (_singletonScript.RoundTrump == "Hearts")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Hearts");
- }
- }
- if (value == "2" || value == "6" || value == "10" || value == "14" || value == "22" || value == "26" || value == "30")
- {
- if (_singletonScript.RoundTrump == "Diamonds")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- else
- {
- _singletonScript.FourthCardCenterRanking("Diamonds");
- }
- }
- if (value == "17" || value == "18" || value == "19" || value == "20")
- {
- _singletonScript.FourthCardCenterRanking("Trump");
- }
- }
- }
- }
- // ------- Определение первого игрока в раздаче -------
- [Command]
- public void CmdWhoFirst(int value)
- {
- RpcWhoFirst(value);
- }
- [ClientRpc]
- public void RpcWhoFirst(int value)
- {
- if (value == 1)
- {
- if (_singletonScript.FirstSpawnCards == true)
- {
- _singletonScript.cardTrump01("Clubs");
- _singletonScript.cardTrump02("Diamonds");
- _singletonScript.cardTrump03("Spades");
- _singletonScript.cardTrump04("Hearts");
- _singletonScript.RoundTrumping("Clubs");
- _singletonScript.FirstSpawnCards = false;
- }
- else
- {
- _singletonScript.RoundTrumping(_singletonScript.CardTrump01);
- }
- }
- if (value == 2)
- {
- if (_singletonScript.FirstSpawnCards == true)
- {
- _singletonScript.cardTrump01("Hearts");
- _singletonScript.cardTrump02("Clubs");
- _singletonScript.cardTrump03("Diamonds");
- _singletonScript.cardTrump04("Spades");
- _singletonScript.RoundTrumping("Clubs");
- _singletonScript.FirstSpawnCards = false;
- }
- else
- {
- _singletonScript.RoundTrumping(_singletonScript.CardTrump02);
- }
- }
- if (value == 3)
- {
- if (_singletonScript.FirstSpawnCards == true)
- {
- _singletonScript.cardTrump01("Spades");
- _singletonScript.cardTrump02("Hearts");
- _singletonScript.cardTrump03("Clubs");
- _singletonScript.cardTrump04("Dimonds");
- _singletonScript.RoundTrumping("Clubs");
- _singletonScript.FirstSpawnCards = false;
- }
- else
- {
- _singletonScript.RoundTrumping(_singletonScript.CardTrump03);
- }
- }
- if (value == 4)
- {
- if (_singletonScript.FirstSpawnCards == true)
- {
- _singletonScript.cardTrump01("Diamonds");
- _singletonScript.cardTrump02("Spades");
- _singletonScript.cardTrump03("Hearts");
- _singletonScript.cardTrump04("Clubs");
- _singletonScript.RoundTrumping("Clubs");
- _singletonScript.FirstSpawnCards = false;
- }
- else
- {
- _singletonScript.RoundTrumping(_singletonScript.CardTrump04);
- }
- }
- if (_singletonScript.FirstSpawnCards == false)
- {
- if (_singletonScript.roundCounter == 1)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName01;
- _singletonScript.playerMass[1] = _singletonScript.pName02;
- _singletonScript.playerMass[2] = _singletonScript.pName03;
- _singletonScript.playerMass[3] = _singletonScript.pName04;
- }
- else if (_singletonScript.roundCounter == 2)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName02;
- _singletonScript.playerMass[1] = _singletonScript.pName03;
- _singletonScript.playerMass[2] = _singletonScript.pName04;
- _singletonScript.playerMass[3] = _singletonScript.pName01;
- }
- else if (_singletonScript.roundCounter == 3)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName03;
- _singletonScript.playerMass[1] = _singletonScript.pName04;
- _singletonScript.playerMass[2] = _singletonScript.pName01;
- _singletonScript.playerMass[3] = _singletonScript.pName02;
- }
- else if (_singletonScript.roundCounter == 4)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName04;
- _singletonScript.playerMass[1] = _singletonScript.pName01;
- _singletonScript.playerMass[2] = _singletonScript.pName02;
- _singletonScript.playerMass[3] = _singletonScript.pName03;
- }
- else if (_singletonScript.roundCounter == 5)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName01;
- _singletonScript.playerMass[1] = _singletonScript.pName02;
- _singletonScript.playerMass[2] = _singletonScript.pName03;
- _singletonScript.playerMass[3] = _singletonScript.pName04;
- }
- else if (_singletonScript.roundCounter == 6)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName02;
- _singletonScript.playerMass[1] = _singletonScript.pName03;
- _singletonScript.playerMass[2] = _singletonScript.pName04;
- _singletonScript.playerMass[3] = _singletonScript.pName01;
- }
- else if (_singletonScript.roundCounter == 7)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName03;
- _singletonScript.playerMass[1] = _singletonScript.pName04;
- _singletonScript.playerMass[2] = _singletonScript.pName01;
- _singletonScript.playerMass[3] = _singletonScript.pName02;
- }
- else if (_singletonScript.roundCounter == 8)
- {
- _singletonScript.playerMass[0] = _singletonScript.pName04;
- _singletonScript.playerMass[1] = _singletonScript.pName01;
- _singletonScript.playerMass[2] = _singletonScript.pName02;
- _singletonScript.playerMass[3] = _singletonScript.pName03;
- _singletonScript.roundCounter = 1;
- }
- }
- }
- // ------- Создание карт на игровом поле -------
- public void CardRecieve(int[] go)
- {
- if (_singletonScript.playerMass[0] == _singletonScript._yourName)
- {
- card01 = Instantiate(Resources.Load(go[0].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
- card01.GetComponent<CardScript>().C = 0;
- card01.GetComponent<CardScript>().cardName = go[0].ToString();
- card01.GetComponent<CardScript>().Player = gameObject;
- card02 = Instantiate(Resources.Load(go[1].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
- card02.GetComponent<CardScript>().C = 1;
- card02.GetComponent<CardScript>().cardName = go[1].ToString();
- card02.GetComponent<CardScript>().Player = gameObject;
- card03 = Instantiate(Resources.Load(go[2].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
- card03.GetComponent<CardScript>().C = 2;
- card03.GetComponent<CardScript>().cardName = go[2].ToString();
- card03.GetComponent<CardScript>().Player = gameObject;
- card04 = Instantiate(Resources.Load(go[3].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
- card04.GetComponent<CardScript>().C = 3;
- card04.GetComponent<CardScript>().cardName = go[3].ToString();
- card04.GetComponent<CardScript>().Player = gameObject;
- card05 = Instantiate(Resources.Load(go[4].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
- card05.GetComponent<CardScript>().C = 4;
- card05.GetComponent<CardScript>().cardName = go[4].ToString();
- card05.GetComponent<CardScript>().Player = gameObject;
- card06 = Instantiate(Resources.Load(go[5].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
- card06.GetComponent<CardScript>().C = 5;
- card06.GetComponent<CardScript>().cardName = go[5].ToString();
- card06.GetComponent<CardScript>().Player = gameObject;
- card07 = Instantiate(Resources.Load(go[6].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
- card07.GetComponent<CardScript>().C = 6;
- card07.GetComponent<CardScript>().cardName = go[6].ToString();
- card07.GetComponent<CardScript>().Player = gameObject;
- card08 = Instantiate(Resources.Load(go[7].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
- card08.GetComponent<CardScript>().C = 7;
- card08.GetComponent<CardScript>().cardName = go[7].ToString();
- card08.GetComponent<CardScript>().Player = gameObject;
- 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)")
- {
- if (_singletonScript.pName01 == _singletonScript._yourName)
- {
- CmdWhoFirst(1);
- }
- else if (_singletonScript.pName02 == _singletonScript._yourName)
- {
- CmdWhoFirst(2);
- }
- else if (_singletonScript.pName03 == _singletonScript._yourName)
- {
- CmdWhoFirst(3);
- }
- else if (_singletonScript.pName04 == _singletonScript._yourName)
- {
- CmdWhoFirst(4);
- }
- }
- }
- if (_singletonScript.playerMass[1] == _singletonScript._yourName)
- {
- card01 = Instantiate(Resources.Load(go[8].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
- card01.GetComponent<CardScript>().C = 8;
- card01.GetComponent<CardScript>().cardName = go[8].ToString();
- card01.GetComponent<CardScript>().Player = gameObject;
- card02 = Instantiate(Resources.Load(go[9].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
- card02.GetComponent<CardScript>().C = 9;
- card02.GetComponent<CardScript>().cardName = go[9].ToString();
- card02.GetComponent<CardScript>().Player = gameObject;
- card03 = Instantiate(Resources.Load(go[10].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
- card03.GetComponent<CardScript>().C = 10;
- card03.GetComponent<CardScript>().cardName = go[10].ToString();
- card03.GetComponent<CardScript>().Player = gameObject;
- card04 = Instantiate(Resources.Load(go[11].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
- card04.GetComponent<CardScript>().C = 11;
- card04.GetComponent<CardScript>().cardName = go[11].ToString();
- card04.GetComponent<CardScript>().Player = gameObject;
- card05 = Instantiate(Resources.Load(go[12].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
- card05.GetComponent<CardScript>().C = 12;
- card05.GetComponent<CardScript>().cardName = go[12].ToString();
- card05.GetComponent<CardScript>().Player = gameObject;
- card06 = Instantiate(Resources.Load(go[13].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
- card06.GetComponent<CardScript>().C = 13;
- card06.GetComponent<CardScript>().cardName = go[13].ToString();
- card06.GetComponent<CardScript>().Player = gameObject;
- card07 = Instantiate(Resources.Load(go[14].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
- card07.GetComponent<CardScript>().C = 14;
- card07.GetComponent<CardScript>().cardName = go[14].ToString();
- card07.GetComponent<CardScript>().Player = gameObject;
- card08 = Instantiate(Resources.Load(go[15].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
- card08.GetComponent<CardScript>().C = 15;
- card08.GetComponent<CardScript>().cardName = go[15].ToString();
- card08.GetComponent<CardScript>().Player = gameObject;
- 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)")
- {
- if (_singletonScript.pName01 == _singletonScript._yourName)
- {
- CmdWhoFirst(1);
- }
- else if (_singletonScript.pName02 == _singletonScript._yourName)
- {
- CmdWhoFirst(2);
- }
- else if (_singletonScript.pName03 == _singletonScript._yourName)
- {
- CmdWhoFirst(3);
- }
- else if (_singletonScript.pName04 == _singletonScript._yourName)
- {
- CmdWhoFirst(4);
- }
- }
- }
- if (_singletonScript.playerMass[2] == _singletonScript._yourName)
- {
- card01 = Instantiate(Resources.Load(go[16].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
- card01.GetComponent<CardScript>().C = 16;
- card01.GetComponent<CardScript>().cardName = go[16].ToString();
- card01.GetComponent<CardScript>().Player = gameObject;
- card02 = Instantiate(Resources.Load(go[17].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
- card02.GetComponent<CardScript>().C = 17;
- card02.GetComponent<CardScript>().cardName = go[17].ToString();
- card02.GetComponent<CardScript>().Player = gameObject;
- card03 = Instantiate(Resources.Load(go[18].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
- card03.GetComponent<CardScript>().C = 18;
- card03.GetComponent<CardScript>().cardName = go[18].ToString();
- card03.GetComponent<CardScript>().Player = gameObject;
- card04 = Instantiate(Resources.Load(go[19].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
- card04.GetComponent<CardScript>().C = 19;
- card04.GetComponent<CardScript>().cardName = go[19].ToString();
- card04.GetComponent<CardScript>().Player = gameObject;
- card05 = Instantiate(Resources.Load(go[20].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
- card05.GetComponent<CardScript>().C = 20;
- card05.GetComponent<CardScript>().cardName = go[20].ToString();
- card05.GetComponent<CardScript>().Player = gameObject;
- card06 = Instantiate(Resources.Load(go[21].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
- card06.GetComponent<CardScript>().C = 21;
- card06.GetComponent<CardScript>().cardName = go[21].ToString();
- card06.GetComponent<CardScript>().Player = gameObject;
- card07 = Instantiate(Resources.Load(go[22].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
- card07.GetComponent<CardScript>().C = 22;
- card07.GetComponent<CardScript>().cardName = go[22].ToString();
- card07.GetComponent<CardScript>().Player = gameObject;
- card08 = Instantiate(Resources.Load(go[23].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
- card08.GetComponent<CardScript>().C = 23;
- card08.GetComponent<CardScript>().cardName = go[23].ToString();
- card08.GetComponent<CardScript>().Player = gameObject;
- 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)")
- {
- if (_singletonScript.pName01 == _singletonScript._yourName)
- {
- CmdWhoFirst(1);
- }
- else if (_singletonScript.pName02 == _singletonScript._yourName)
- {
- CmdWhoFirst(2);
- }
- else if (_singletonScript.pName03 == _singletonScript._yourName)
- {
- CmdWhoFirst(3);
- }
- else if (_singletonScript.pName04 == _singletonScript._yourName)
- {
- CmdWhoFirst(4);
- }
- }
- }
- if (_singletonScript.playerMass[3] == _singletonScript._yourName)
- {
- card01 = Instantiate(Resources.Load(go[24].ToString()), spawnSpot01.transform.position, spawnSpot01.transform.rotation) as GameObject;
- card01.GetComponent<CardScript>().C = 24;
- card01.GetComponent<CardScript>().cardName = go[24].ToString();
- card01.GetComponent<CardScript>().Player = gameObject;
- card02 = Instantiate(Resources.Load(go[25].ToString()), spawnSpot02.transform.position, spawnSpot02.transform.rotation) as GameObject;
- card02.GetComponent<CardScript>().C = 25;
- card02.GetComponent<CardScript>().cardName = go[25].ToString();
- card02.GetComponent<CardScript>().Player = gameObject;
- card03 = Instantiate(Resources.Load(go[26].ToString()), spawnSpot03.transform.position, spawnSpot03.transform.rotation) as GameObject;
- card03.GetComponent<CardScript>().C = 26;
- card03.GetComponent<CardScript>().cardName = go[26].ToString();
- card03.GetComponent<CardScript>().Player = gameObject;
- card04 = Instantiate(Resources.Load(go[27].ToString()), spawnSpot04.transform.position, spawnSpot04.transform.rotation) as GameObject;
- card04.GetComponent<CardScript>().C = 27;
- card04.GetComponent<CardScript>().cardName = go[27].ToString();
- card04.GetComponent<CardScript>().Player = gameObject;
- card05 = Instantiate(Resources.Load(go[28].ToString()), spawnSpot05.transform.position, spawnSpot05.transform.rotation) as GameObject;
- card05.GetComponent<CardScript>().C = 28;
- card05.GetComponent<CardScript>().cardName = go[28].ToString();
- card05.GetComponent<CardScript>().Player = gameObject;
- card06 = Instantiate(Resources.Load(go[29].ToString()), spawnSpot06.transform.position, spawnSpot06.transform.rotation) as GameObject;
- card06.GetComponent<CardScript>().C = 29;
- card06.GetComponent<CardScript>().cardName = go[29].ToString();
- card06.GetComponent<CardScript>().Player = gameObject;
- card07 = Instantiate(Resources.Load(go[30].ToString()), spawnSpot07.transform.position, spawnSpot07.transform.rotation) as GameObject;
- card07.GetComponent<CardScript>().C = 30;
- card07.GetComponent<CardScript>().cardName = go[30].ToString();
- card07.GetComponent<CardScript>().Player = gameObject;
- card08 = Instantiate(Resources.Load(go[31].ToString()), spawnSpot08.transform.position, spawnSpot08.transform.rotation) as GameObject;
- card08.GetComponent<CardScript>().C = 31;
- card08.GetComponent<CardScript>().cardName = go[31].ToString();
- card08.GetComponent<CardScript>().Player = gameObject;
- 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)")
- {
- if (_singletonScript.pName01 == _singletonScript._yourName)
- {
- CmdWhoFirst(1);
- }
- else if (_singletonScript.pName02 == _singletonScript._yourName)
- {
- CmdWhoFirst(2);
- }
- else if (_singletonScript.pName03 == _singletonScript._yourName)
- {
- CmdWhoFirst(3);
- }
- else if (_singletonScript.pName04 == _singletonScript._yourName)
- {
- CmdWhoFirst(4);
- }
- }
- }
- _singletonScript.ScoreTeamOne = 0;
- _singletonScript.ScoreTeamTwo = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement