//[Client] public void ReduceDiseaseSpread(string color, _roleCard roleCard) { if (GameManager.instance.GetCureFromString(color) || roleCard.role == _roleCard.roleType.MEDIC) { foreach (SpriteRenderer t in diseaseCubes.Where(t => t.color == GetColorFromString(color))) { t.enabled = false; diseaseSpread--; GameManager.instance.SetDiseaseSpread(color,-1); } } else { foreach (SpriteRenderer t in diseaseCubes.Where(t => t.color == GetColorFromString(color) && t.enabled)) { t.enabled = false; diseaseSpread--; GameManager.instance.SetDiseaseSpread(color, -1); return; } } }
//[ClientRpc] public void Initialize(int role) { //active = false; gameManager = GameManager.instance; count = 0; actionsTaken = new int[1000][]; actionsLeft = 4; hand = new GameObject("Hand").AddComponent<Hand>(); hand.transform.parent = transform; hand.Initialize(this); cityID = 4; CurrentCity = GameManager.GetCityFromID(4); Debug.Log(role); Debug.Log(GameManager.roleCardStack.cards.Count); Card tempRole = GameManager.roleCardStack.cards[role]; this.roleCard = tempRole as _roleCard; //this.roleCard = (_roleCard) GameManager.roleCardStack.cards[roleCard]; //GameManager.roleCardStack.roleCards.Contains(roleCard); //Error? MoveToCity(cityID); CurrentCity.UpdatePawns(); }
public void createRoleCards() { _roleCard[] roleCards = new _roleCard[7]; cards = new List<Card>(); for (int i = 0; i < roleCards.Length; i++) { roleCards[i] = new GameObject().AddComponent<_roleCard>(); roleCards[i].transform.parent = transform; } Debug.Log("Creating Role Cards"); roleCards[0].name = ("MEDIC"); roleCards[1].name = ("DISPATCHER"); roleCards[2].name = ("QURANTINE SPECIALIST"); roleCards[3].name = ("CONTINGENCY"); roleCards[4].name = ("RESEARCHER"); roleCards[5].name = "SCIENTIST"; roleCards[6].name = "OPERATIONS EXPERT"; roleCards[0].role = _roleCard.roleType.MEDIC; roleCards[1].role = _roleCard.roleType.DISPATCHER; roleCards[2].role = _roleCard.roleType.QURANTINE_SPECIALIST; roleCards[3].role = _roleCard.roleType.CONTINGENCY; roleCards[4].role = _roleCard.roleType.RESEARCHER; roleCards[5].role = _roleCard.roleType.SCIENTIST; roleCards[6].role = _roleCard.roleType.OPERATIONS_EXPERT; for (int i = 0; i < roleCards.Length; i++) { cards.Add(roleCards[i]); } }