Hey, I’m trying to make an editor window so I just copied the code from the script reference but it doesn’t work? I changed all the names to the name of my script??? Has something changed, it has a option in the “window” tab but clicking on this returns nothing? And it is in the “Editor” folder.
This is the code:
// JavaScript example:
class UVsprite extends EditorWindow
{
var myString = "Hello World";
var groupEnabled = false;
var myBool = true;
var myFloat = 1.23;
// Add menu named "My Window" to the Window menu
@MenuItem ("Window/UVsprite")
static function Init ()
{
// Get existing open window or if none, make a new one:
var window = ScriptableObject.CreateInstance.<UVsprite>();
}
function OnGUI ()
{
GUILayout.Label ("Base Settings", EditorStyles.boldLabel);
myString = EditorGUILayout.TextField ("Text Field", myString);
groupEnabled = EditorGUILayout.BeginToggleGroup ("Optional Settings", groupEnabled);
myBool = EditorGUILayout.Toggle ("Toggle", myBool);
myFloat = EditorGUILayout.Slider ("Slider", myFloat, -3, 3);
EditorGUILayout.EndToggleGroup ();
}
}
Yeah that didn’t work I tried changing Init to Initiate as well but no luck
its very frustrating that they let their docs go, they used to be some of the best but now there is probably like 20-30% are wrong and don’t work… They need to update the reference as soon as they add or change something and each web page needs a last edited time, I also think a wiki section built in to this would be great, so anyone can put up example scripts and info.
And yeah i probably should use c# but I find US more readable and ATM i’m not doing anything complex.