I’m in the process of creating a quest manager, I wanted to create a custom window where a user could fill in text fields and then dynamically add in “task” objects so that you could make a quest where all you do is talk to 1 NPC, or a quest where you talk to 1 NPC, kill 5 NPCs, gather their Heads and hand into the original NPC.
I’ve an old project where I am creating a tile manager so I’ve created a custom window before, however I’m having just the most ridiculous time making it appear of all things!
Here’s my code:
using UnityEngine;
using UnityEditor;
public class QuestEditor : EditorWindow
{
[MenuItem("Window/Quest Editor")]
public static void CreateEditor()
{
EditorWindow.GetWindow<QuestEditor>("Quest Editor");
}
private void OnGUI()
{
//Do Quest Stuff
}
}
And here’s my project setup / what I see when opening the Window option:
This is infuriating me to no end, all I can find online is to add an editor folder or add in the code I already have. This is the minimum amount of code I need to create this functionality, I’ve no idea what I’m missing, I feel it has to be either some tool change I don’t know or so infinitesimally small I may blow my brains out.
i found a fix for this issue, it is not the best but it is better than trying silly things hoping that it will work
first in the menu item method reponsable for spawning your window try this
[MenuItem("Tools/Services")]
public static void Services()
{
var win= EditorWindow.GetWindow(typeof(ServicesWindow), true, "services Settings", true);
DestroyImmediate(win);
}
execute this once then transform your menu item method again to this