Hey there.
Currently I work in Unity 5.6.0f3(can anyone having 5.6.1+ check if they have this issue?) and have a following issue: MenuItem does not work in editor scripts when opening a project with a compilation error in a runtime script.
Here’s how to reproduce this:
Completely empty project, where there are only 2 files(code in the end of the message).
- An editor script(that definetely compiles just fine on its own):
Path: “Assets/Plugins/Editor/UnityCodeGenerator.cs”
(tried puttin it into “Assets/Editor”, “Assets/Standard Assets/Editor”, etc - nothing worked)
a runtime script I made a compilation error in:
“Assets/BrokenScript.cs”
If I open this project, there is no “Entitas” menu item in the top menu. If I fix a compilation error in BrokenScript it appears and further runtime compilation errors do not make it disappear. Making a compilation error in a runtime script and relaunching the project does though, which is a big issue for me at the moment.
Code:
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Entitas.CodeGeneration.Unity.Editor
{
public static class UnityCodeGenerator
{
[MenuItem(“Tools/Entitas/Generate #%g”, false, 100)]
public static void Generate()
{
Debug.LogError(“TEST”);
}
}
}
using UnityEngine;
public class BrokenScript : MonoBehaviour {
void Start () {
weq
}
}