Случайный выбор числа из массива в Unity3D - C#
Формулировка задачи:
Привет всем, помогите пожалуйста сделать случайный выбор числа из массива в Unity3D. Заранее спасибо.
using UnityEngine;
using System.Collections;
public class interfeis : MonoBehaviour {
public int[] m1 = new int[14];
public int b;
Random rnd = new Random();
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
void OnGUI()
{
GUI.Box (new Rect (650, 500, 50, 50), "");
}
}Решение задачи: «Случайный выбор числа из массива в Unity3D»
textual
Листинг программы
int index = UnityEngine.Random.Range(0, m1.Length); Debug.Log(m1[index]);