ランダムな値を取得して遊ぶ
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 RollADice(){ | |
// 乱数の範囲指定で配列のインデックスを取得する | |
int index = Random.Range(0, dice.Length); | |
// サイコロの目を取得する | |
int pips = dice[index]; | |
Debug.Log("サイコロの目は " + pips + " でした。"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment