public void Flip() { cardIndex = 0; foreach (GameObject card in cards) { cardModel = card.GetComponent <Card_Model>(); flipper = card.GetComponent <CardFlipper>(); flipper.FlipCard(cardModel.cardBack, cardModel.faces[cardIndex], cardIndex); cardIndex++; } }
void Awake() { sourceImage = GetComponent <Image>(); model = GetComponent <Card_Model>(); }