How to make public variable read-only during run-time ??

Hello.
I would like to be able to “lock” variables in the inspector during runtime.

I have some public variables that are only used in the start and never in the update.

I want that once the execution starts they become read only, because even if you change them you will not see changes in the execution and people (or me in the future) may make a mistake.

I have found this ( and tested it ):

If I use the CustomAttribute created “[ReadOnlyWhenPlaying]” they become readonly on execution, but if I use a [Range(0,10)] the slider never appears (it is a numerical textbox).

If I use “[Range(0,10)]” before “[ReadOnlyWhenPlaying]” the slider appears but the readonly does not work.

What is missing in the “ReadOnlyWhenPlayingAttributeDrawer.cs” to make it work properly?
(Check the code of the file in the link)

Thanks.

PS: Text is translated with Deepl Translator (sorry if exists mistakes).

Rather than relying on attributes, I prefer to make this obvious in the code by renaming the variables.

Instead of “Number Of Lives,” which is ambiguous, I would call it:

“Initial Number Of Lives”

Then that number is copied to another variable that actually tracks the lives during play.

That’s plan B.
But I prefer the exposed plan A, if is possible.