void ceckCardType() { CardPropFirstCard = CardHolder.transform.GetChild(0).GetComponent <CardProp> (); for (int i = 0; i < Hand1.transform.childCount; i++) { string cardType = setCard(i); if (cardType == CardPropFirstCard.Type) { draggble.enabled = true; } else if (cardType != CardPropFirstCard.Type) { draggble.enabled = false; cardImage.color = new Color32(164, 164, 164, 255); Debug.Log(CardPropFirstCard.Type); playableCardCounter++; } } if (playableCardCounter >= Hand1.transform.childCount) { Debug.Log(playableCardCounter); for (int i = 0; i < Hand1.transform.childCount; i++) { setCard(i); draggble.enabled = true; cardImage.color = Color.white; } } }
void playGround() { firstCard = targetOject.transform.GetChild(0).gameObject; cardProp = firstCard.GetComponent <CardProp> (); cardType = cardProp.Type; Debug.Log(cardType); }
public static void LoadData() { for (int i = 0; i < GlobalVariable.FightCards.Count; i++) { fightCardsGrids[i] = new CardProp(GlobalVariable.FightCards[i], i); count++; } Show(); }
public void CancelSelect(CardProp card) { foreach (GameObject t in cardgridobjects) { if (t.GetComponent <CardSelect>().gameProp.Equal(card.index)) { t.transform.Find("card-style").GetComponent <SpriteRenderer>().material = Resources.Load <Material>("materials/Default"); t.transform.Find("card-raw-img").GetComponent <SpriteRenderer>().material = Resources.Load <Material>("materials/Default"); } } }
void disreputeCards() { Image randomCard; for (int i = 0; i < 8; i++) { do { randIndex = Random.Range(0, 51); }while(randomNum.Contains(randIndex)); randomNum.Add(randIndex); randomCard = CardsList[randIndex]; cardPro = randomCard.transform.GetComponent <CardProp> (); if (cardPro.Type == "Diamond") { DiamondImages.Add(randomCard); } else if (cardPro.Type == "club") { ClubImages.Add(randomCard); } else if (cardPro.Type == "Heart") { HeartImages.Add(randomCard); } else if (cardPro.Type == "Spade") { SpadesImages.Add(randomCard); } } //oreder the card in the hand. for (int i = 0; i < DiamondImages.Count; i++) { DiamondImages[i].transform.SetParent(Hand1.transform); } for (int i = 0; i < ClubImages.Count; i++) { ClubImages[i].transform.SetParent(Hand1.transform); } for (int i = 0; i < HeartImages.Count; i++) { HeartImages[i].transform.SetParent(Hand1.transform); } for (int i = 0; i < SpadesImages.Count; i++) { SpadesImages[i].transform.SetParent(Hand1.transform); } }
public void LoadCard(GameProp temp, int t) { gameProp = new CardProp(temp, t); }
public void SetGameProp(CardProp temp) { gameProp = temp; }