Answer the question
In order to leave comments, you need to log in
What is the best way to make a non-long unique value?
I have two types of objects - static and dynamic, of course I simply number static ones, but dynamic ones need to be given unique values, since there can be many of them and they can often appear and be destroyed, the most important thing is that their keys do not repeat, and it’s better of course, so that they are not too long, otherwise I now do them like this ...
private string GenerateNum(){
string num = DateTime.UtcNow.ToString() + UnityEngine.Random.Range(0f, 10000f) + DateTime.UtcNow.ToString() + UnityEngine.Random.Range(0f, 10000f);
return num;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question