Defining a public class in C#

Hi, I am starting to really get my hands deep in regards of C#, but I really don’t get how you define a class in C#(a class that is view-able in the Inspector)

In regards of JavaScript you define a class like this:

class className{
//Whatever
}

var CN : className; // This is what I dont get in C#

(That example is view-able and editable in the inspector)

In C# I currently got:

   public class className{
   //Whatever
   }

(This class won’t show in the Inspector)

My question is; how can I make a class(in C#) show in the editor? I looked at the Microsoft C# reference, but it didn’t help me that much.

Any help would be much appreciated.

Simple- you need to tell the compiler that a given class should be able to be shown in the editor using the ‘System.Serializable’ attribute. In this case, use it like this-

[System.Serializable]
public class Foo
{
    public string text;
    public int number;
    public float value;
}