How to make costume classes Visible in the Inspector

The Class:

[Serializable]
public class LowPolyMapSettings : MonoBehaviour {

	//private
	private float _SegmentWidth		= 1f;
	private float _SegmentHeight	= 1f;
	
	private int _NumberOfSegmentsAtXAxis = 1;
	private int _NumberOfSegmentsAtZAxis = 1;

	//Fields
	public float SegmentWidth { 
		set {
			if (value > 0){
				_SegmentWidth = value;
			} else {
			throw new ArgumentException(" < 0 ");
		}
		}
		get {
			return _SegmentWidth;
		}
	}

	public float SegmentHeight {
		set {
			if (value > 0){
				_SegmentHeight = value;
			} else {
			throw new ArgumentException(" < 0 ");
		}
		}
		get {
			return _SegmentHeight;
		}
	}
	
	public int NumberOfSegmentsAtXAxis {
		set {
			if (value > 0){
				_NumberOfSegmentsAtXAxis = value;
			} else {
			throw new ArgumentException(" < 0 ");
		}
		}
		get {
			return _NumberOfSegmentsAtXAxis;
		}
	}

	public int NumberOfSegmentsAtZAxis {
		set {
			if (value > 0){
				_NumberOfSegmentsAtZAxis = value;
			} else {
			throw new ArgumentException(" < 0 ");
		}
		}
		get {
			return _NumberOfSegmentsAtZAxis;
		}
	}

	public LowPolyMapSettings(int NumberOfSegmentsAtXAxis,int NumberOfSegmentsAtZAxis,
	                          float SegmentWidth, float SegmentHeight){

		this.NumberOfSegmentsAtXAxis = NumberOfSegmentsAtXAxis;
		this.NumberOfSegmentsAtZAxis = NumberOfSegmentsAtZAxis;
		this.SegmentWidth = SegmentWidth;
		this.SegmentHeight = SegmentHeight;

	}

}

I can instantiate this class in the inspector -.- how to do this ?

What you labeled as “Fields” in your comments are actually properties.
Properties do not appear in the inspector. Public instance variables ( a.k.a. fields ) do.

Whichever variables you want to appear in the inspector, just change them to public.

As kacyesp said, Your fields are actually properties, which won’t be serialized automatically by Unity.

There’s a way to make editor scripts to actually allow properties to be serialized, which is not so easy to implement (in my opinion, but then again, I guess that’s my lazy side - i would consider doing it if you plan on serializing lots of properties.)

Here’s a link to how to get this to work.

I personally haven’t tried it out and I don’t quite get the quirks of it yet. But i believe it does expose properties.

Your other solution is to use public variables - again like kacyesp said.

BUT - Instead of going with Start() or OnEnable(), I suggest you use OnValidate(), Which is called whenever there’s a modification made in the inspector.
Look it up

You can display the private fields in the editor by using [SerializedProperty] attribute:

[SerializedProperty]
private float _SegmentWidth = 1f;

You have to put it over every variable you want to display. But that let’s you keep the encapsulation while allowing editor access.

As for validation, I think you may be able to get away with making a custom property drawer that will work something like [Range(min, max)] but where you can set just the min Property Drawer Scripting Reference