Created
June 25, 2018 13:15
-
-
Save todorok1/f9934150a895baaa663fe3d8cdeca925 to your computer and use it in GitHub Desktop.
カードをランダムにシャッフルするサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ShuffleCards(){ | |
// カードをシャッフルする | |
for (int i = 0; i < cardList.Count; i++){ | |
Card temp = cardList[i]; | |
int randomIndex = Random.Range(0, cardList.Count); | |
cardList[i] = cardList[randomIndex]; | |
cardList[randomIndex] = temp; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment