How is it bad? Genuinely curious to see if the implementation is actually different or if your IDE is simply displaying bad documentation. There is nothing listed in the release notes about a change for Random.Range…
Looks like it’s showing the description for the wrong overload. OP’s says it returns a random float, while @Timelog 's says it returns a random int. Probably just an IDE bug.
Yup, It’s also showing up as exclusive for me. I was wrong earlier, I’m on f3 too. Also ran a test where it’s exclusive.
It’s probably just MonoDevelop being broken because MonoDevelop is always broken. Hell, if you asked me “do you think MonoDevelop would show the docs for the correct overload” before this thread, I’d say that the safe bet would be “no”
The docs are found in UnityEngine.XML, which is next to the .dll
Open it, and search for Random.Range, see the one for int.
Looking at your original post, note that it says “float” in the description, you’re definitely getting the float one. The question is if there’s a bug where the doc-string is broken, or if it’s an MD bug.
I mean, it’s an MD bug since MD is utter garbage, but you can check for yourself.
Unfortunately Random.Range is actually calling a function on the C/C++ side of the engine so we can’t see the actual implementation. Post the results of the following code if you want to be sure…
int inclusiveMaxCount = 0;
for (int i = 0; i < 1000000; ++i)
{
if (Random.Range(0, 1) == 1) { ++inclusiveMaxCount; }
}
Debug.Log("Detected " + inclusiveMaxCount + " instances of an inclusive max range.");
So your screenshot isn’t white because you’re using MonoDevelop, it’s white because you’ve actually chosen to use the horrible default VS color scheme?
Why do you hate your eyes so? What did they do to you?
That’s definitely a bad bug. Is VS Tools for Unity installed? Did you install it with the installer or manually?