Esempio n. 1
0
    private static void Create(MonoScript script)
    {
        if (EditorApplication.isCompiling)
        {
            Debug.LogError("Busy compiling");
            return;
        }
        Type type = script.GetClass();

        if (type == null)
        {
            Debug.LogError(script.name + " is not a valid MonoBehvaiour. (Make sure the class name match the filename)");
            return;
        }
        string           folderPath = PathUtility.CreateEditorScriptPath(script);
        string           filename   = type.Name + "Editor.cs";
        IScriptGenerator generator  = new SimpleInspectorGenerator(type.Name, type.Namespace);

        ScriptSaver.GenerateScript(folderPath, filename, generator);
    }