public static void Init() { selectedObject = Selection.activeObject; if (selectedObject == null) { return; } CreateAnimations window = (CreateAnimations)EditorWindow.GetWindow(typeof(CreateAnimations)); window.Show(); }
static void Init() { //Grab the active object selectedObject = Selection.activeObject; //If the object doesn't exist, do nothing if (selectedObject == null) { return; } //Otherwise, create a new window CreateAnimations window = (CreateAnimations)EditorWindow.GetWindow(typeof(CreateAnimations)); //Show the window window.Show(); }