Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active June 18, 2018 11:50
Show Gist options
  • Save todorok1/2c1cb469997b44487a2d4460e9737e7e to your computer and use it in GitHub Desktop.
Save todorok1/2c1cb469997b44487a2d4460e9737e7e to your computer and use it in GitHub Desktop.
ランダムな値を取得して遊ぶ
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