add version

Pages in both the old school and the package docu are lacking something very important: the version that the struct/class/method was introduced.
Unity changes to rapidly that this is essential to find compatible package.

On the normal docs, the version dropdown has “versions with this page” and “versions without this page”.

It’s not perfect, as it means that the docs were introduced in that version, rather than the type/member/function, but it’s better than nothing. Having actually “version introduced in” is probably going to take a lot of backtracking work if it’s not already written down, since somebody would have to manually check everything!

For api docs,
here’s Greasemonkey script to display first added version on the page:

(it just takes the last item from that dropdown menu)

8857771--1208362--upload_2023-3-7_10-46-12.png

2 Likes

How do I use it?

  1. Install https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
  2. Click the greasemonkey icon in firefox toolbar, select New User Script
  3. Take raw script source from https://gist.github.com/unitycoder/48b46d0192e2cce356c2731c8f274880#file-unitydocsshowfirstversionadded-cs
  4. Paste into user script, Save
  5. Refresh docs page, like https://docs.unity3d.com/ScriptReference/LowLevel.PlayerLoop.html

*might have some bugs still, it doesnt do any error checking…

1 Like

nice!!
8860398--1208892--upload_2023-3-7_23-53-20.png

thanks!

(it’s called tampermonkey on brave)

ok, so the same script runs there without modifications needed? good to know.

for the original request,
unity could literally just add few lines of code, to do the same from their side…

1 Like

Nice. Thanks

nice it’s working.

script updated, to handle those version specific pages, like:
https://docs.unity3d.com/**2023.3**/Documentation/ScriptReference/Collider2D.ClosestPoint.html

previously only these urls would trigger it:

Thanks! Super useful.