Why isn't my class editable in the inspector?

I have a custom class Effect that I use for buffs, and I’d like to be able to drag and drop it into public Effect variables in the inspector. To that end, I put [System.Serializable] immediately before the class declaration, but when I go to view variables of type Effect in the inspector it displays solid gray after the variable name, and trying to drag an Effect into the slot yields the black circle with a strike-out through it. I was under the impression that System.Serializable was all I needed to expose a class in the inspector, am I doing something obviously wrong?

In C# variables are private by default, and private variables are not serialized. You need to make them public by adding the keyword public infront of both the variables in the Effect class and the testEffect variable in the TestScript class.

Or you can add the property [SeralizeField] before the variable, and it will be serialized even when private.