In the video on that page, at 3:45, it is said that protected variables in that class would be visible and directly editable in classes that inherit it.
It appears that it’s working in the video but it doesn’t work for me. Why is that? Or why have things changed?
- The serialized and public fields are visible in the clases that inherit my class, as intended.
- although they are invisible in the Inspector, protected variables are accessible via code; serializing these variables makes them inaccessible via code in the Favori class.
Noticed in 2020.1.0b4 and 2019.2.21f1 in Linux Mint 19.3.
The scripts:
using UnityEngine;
public class Compagnon : MonoBehaviour
{
//"nom" is the name that should show in Debug.Log in the Favori class
protected string nom;
[SerializeField] int age;
public string race;
protected string sexe;
//"texte" is the text that should show in Debug.Log in the Favori class
protected string texte;
private void Start()
{
Parle();
}
protected virtual void Parle()
{
Debug.Log(texte);
}
}
using UnityEngine;
//Favori class inherits the Compagnon class
public class Favori : Compagnon
{
protected override void Parle()
{
//"nom" and "texte" are set in the Compagnon class
//and are assigned a value in the Inspector
Debug.Log(nom + " " + texte);
}
}
In the Inspector:
Both private and protected are “invisible” to the outside. The only difference between the two is that inherited classes are allowed to see protected variables, but not private ones.
Your int age variable is private per default, since that is how classes work in c# (with structs you’d have a public variable). The [SerializeField] tag makes your age variable visible to the inspector. As I said before, protected variables act like private, except for inherited classes and can be seen as private to the “outside world”.
Tl;dr; add the [SerializeField] tag to your protected variable and it should be visible in the inspector.
Thanks for your answer; it doesn’t tell me why it works in the video and not in my project though. 
Indeed but the serialized fields are inaccessible via code in the Favori class.
To put it shortly:
- protected fields are invisible in the Instpector but accessible via code in Favori,
- serialized fields are visible in the Inspector but inaccessible via code in Favori.
In the video protected fields are visible in the Inspector and accessible via code.
I can’t really watch the video and don’t want to extra subscribe to the Unity learning page I won’t be using, so I will only explain how I know it and understand it, not based on the video.
The [SerializeField] tag is Unity specific, this has nothing to do with accessability in your c# code.
int age;
and
[SerializeField]
int age;
are BOTH private variables! The difference ONLY being the visibility in the inspector (although the serializefield does do some additional stuff, but it’s not important for your case).
Private variables are NEVER accessible in code from inherited classes, while protected variables are. Adding [SerializeField] to a protected member will NOT change its accessibility in your code!
The points in your answer are thus completely correct!
You can think of [SerializeField] telling Unity “please remember this variable in your serialization and remember it in the scene”. Unity does this per default on public members with base types (int, char, …), arrays of base types (int[ ]…,char[ ]…), lists of base types (List, List,…) and the same for Unity specific types (GameObject, Transform,…). Private variables are NOT serialized per default. Adding [SerializeField] to a public int for example, would change absolutely nothing, since it’s serialized per default!
Ok I had a quick look and now I’m even more confused.
The video only explains from a c# view how inheritation works. There are no variables visible within the inspector, what you’re asking has nothing to do with the video…
I think I’ve explained the mechanics of visibility in the inspector thoroughly. It’s important for you to understand that inspector visibility and code access modifiers are two different things
You could do all of the example code without a single [SerializeField] clause.
Yes there is, one, the name. 
At the end of the video, no variables are showing. The name shows at the BEGINNING of the video because the variable was PUBLIC. He changes it to PROTECTED, making the variable disappear.
If all you’re gonna do is nitpick everything I write instead of actually trying to read, I’m done here…