Problems with creating own inspector GUI

I’m trying to create own inspector GUI script, with some settable values (Prefabs, dimensions) and some custom buttons and sliders.
GUI functions work ok, but every EditorGUI function(IntField, TextField) is throwing error - NullReferenceException: Object reference not set to an instance of an object.
Are EditorGUI functions not meant to be used in Inspector, or am i doing something wrong?

@CustomEditor (MapControll)
class MapEditorControll extends Editor{
	
	private var res: String = "";
	
	function OnInspectorGUI () {
		var levelObj : MapControll = target;
	    
		res = GUILayout.TextField("X", res);
        res = EditorGUILayout.TextField("X", res);
        Repaint();
	}
}

My second trouble is with height of inspector layout. My only success was when i used BeginScrollView. Also i was not able to find any documentation for Editor class.

@CustomEditor (MapControll)
class MapEditorControll extends Editor{
	
	private var res: String = "";
	private var scrollPos : Vector2;
	
	function OnInspectorGUI () {
		var levelObj : MapControll = target;

		scrollPos = GUILayout.BeginScrollView(scrollPos, GUILayout.Height(100.0));
		res = GUILayout.TextField(res);
		GUILayout.EndScrollView();
 
        Repaint();
	}
}

I do not fully understand Unity GUI yet, but this is really causing me a headache. Is there any GOOD tutorial for enhancing Unity Editor?

Regarding the first problem: Is that all of the source involved? Don’t see any immediate error there. Second problem: No, UnityEditor.Editor is unfortunately not yet documented.

Regarding positioning, I only use EditorGUILayout. On rare occasions where do I need to access and absolute position, I use GUILayoutUtility.GetLastRect();

If you want to use fixed-positioned GUI, you would typically use GUILayoutUtility.GetRect to get a rectangle back, then use that rectangle in your fixed-position GUI.

Could you submit your nullref as a bug (with repro case) - I’d like to take a look at it.

I will submit, but in order to do that i would like to prepare scene with reproducable bug…
Problem is that currently none CustomEditor script is working. ( althought they are successfully compiled and all other editor script types are working just fine)… I’m submitting that problem right now.

Any news on this one? I have the same exact problem in Unity iPhone 1.0.2.

void OnInspectorGUI()
	{
		
		EditorGUI.IntField(new Rect(10, 3, 200, 20), "Width", 0);
		
	}

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorGUI.IntField (Rect position, System.String label, Int32 value)   (at /Users/build/builds/unity-iphone-1.0.3/iphone-1.0.3/Editor/Mono/Generated/EditorGUI.cs:1254)
TilemapEditor.OnInspectorGUI ()   (at Assets/Editor/TilemapEditor.cs:94)

ObjectField doesn’t cause the same problem, but it doesn’t let me change the value in any way either.