Problem when trying to show an editor window...

Hello!

I feel really dumb, but I can’t get to show an Editor Window… Here’s my code (mostly taken from the documentation):

using UnityEngine;
using UnityEditor;

public class Validation : EditorWindow
{
  private string _text;

  [MenuItem ("Validation/Validate Scene Materials...")]
    static void Init()
    {
      Validation window = (Validation) EditorWindow.GetWindow(typeof (Validation));
      window.Show ();
    }

  void OnGUI ()
  {
    string test = "";
    foreach (Transform t in Selection.transforms)
      {
        test += t.name;
      }
    EditorGUI.TextField(new Rect(50, 50, 100, 30), "allo", test);
  }
}

I get the following error:

Any clues on what I’m doing wrong… O_o’

Thanks!

sounds like you try to use unity 2.6 editor code with Unity iPhone which is unity 2.1 editor based or vice versa.

Editor scripts are not transportable between Unity and Unity iphone at the time (especially not unity → unity iphone)

I see… sigh, I wish the iPhone version of unity could be the same as the normal branch…

Many thanks for the help!

@dreamora – Is this still an issue with the current version of Unity iPhone? (sorry to res this old thread)