I want to generate a unique random digit between 1 and 10. If a number gets repeated then the script should skip the number and try for another. If there are no unique numbers left then a message should be generated. Any logic to get this concept implemented?
public int number;
void Update () {
if(Input.GetKeyDown(KeyCode.A))
{
number= Random.Range(1,10);
}
}
EDIT: It is not a duplicate of the link the user posted since I am trying to generate unique number and if a particular number is repeated, the script ignores it and tries to look for another number.