Custom EditorWindow problem

Hi, I am trying to build a custom window view for my classes so I can edit their relations easily. However I hit an obstacle at the very start. Error says EditorWindow does not have a definiton for GetWindow method. Code is :

using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Linq;


public class DialogTreeWindow: EditorWindow {
	
	[MenuItem ("Window/DialogTreeView")]
	public static void Init()
	{
		DialogTreeWindow Window= EditorWindow.GetWindow<DialogTreeWindow>();
	}
	
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

1 Answer

1

replace with :

DialogTreeWindow window = (DialogTreeWindow) EditorWindow.GetWindow(typeof(DialogTreeWindow));

Thanks for the fast answer. I don't understand what was wrong about what I had written but this has worked very well.

–

You're welcome. If I helped you out, click the check-mark on the left of my answer ;). Also you should reply with comments, not answers to keep things clean.( You can click ->more ->convert to comment)

–