Function of HideInInspector

An attribute named "HideInInspector" has this function: Makes a variable not show up in the inspector but be serialized.

What is meant by "be serialized" here? Thanks.

Any variables that you can edit in the Inspector are serialized, which means "saved with the scene".

There are times when you wants things serialized, and/or you want to have public variables, but you don't want to see the clutter of variables that you're not going to edit. For example, a lot of things that you could do in the Start() or Awake() functions, I do with Editor scripting, and then I save the important results in variables. (This reduces the amount of code in the runtime scripts, makes it so you don't need to worry about the execution order of Start/Awake, or pass parameters around in those functions, and makes the game start a little faster.)

Due to their protection level, these variables would normally show up in the Inspector, but I won't ever set them up manually. Hence, HideInInspector is very nice, to make it easier to look at the Editor.