Hi friends, I’m asking this question after searching this forum for similar problems but they are not helpful for me. I am creating a card game. I’ve created string array of cards player has >
var playerCards : Array = ["playerCard1", "playerCard2", "playerCard3", "playerCard4", "playerCard5", "playerCard6", "playerCard7", "playerCard8", "playerCard9", "playerCard10"];
While playing game, the player will select one of these cards. I want that card to give/ display its index in array, so that I can compare it with another card and see whether they match or not like this >
if (playerCardID == enemyCardID)
{
Debug.Log ("CARDS MATCHED!!!");
}
I need indexes of playerCardID only, those of enemyCardID will be generated randomly.
SO what is the solution for this one. can you help plz. Thanx