Trabla: Unity3D & C#: generate random number
Solving:
using UnityEngine;
using System.Collections;
using System;
public class MyScript : MonoBehaviour {
public int randomValue;
void Start(){
System.Random random = new System.Random();
this.randomValue = random.Next( 1, 20 );
}
No comments:
Post a Comment