TD Starter kit Editor menu unable to execute



  • Hi I started using the TD Starter kit today, freshly imported into a new project along with SteamVR, VRTK and a couple art asset packs.

    I'm currently using Unity 5.6.0f3 with visual studio 2017 installed.  I'm trying to use
    Window > TD Starter Kit > Enemy Setup
    Window > TD Starter Kit > Projectile Settings
    Window > TD Starter Kit > Tower Setup
    But they do not show the dialog.  All the rest of the TD Starter Kit menu options work.
    Unity gives these errors when opening the project

    UnityException: NameToLayer is not allowed to be called during serialization, call it from OnEnable instead. Called from ScriptableObject 'DockArea'.
    See "Script Serialization" page in the Unity Manual for further details.
    EnemySetup..ctor () (at Assets/3DTowerDefenseStarterKit/Scripts/Editor/EnemySetup.cs:32)
    UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    
    

    http://i.imgur.com/t6YYNEO.png



  • Hi there,

    thanks for your report! Weird that I haven't encountered this earlier. I have now uploaded a new package to the Asset Store fixing these things. It has the same version number (1.7.3), but if you see that the date next to it changed to 'today', then that's the correct one to download.



  • Thank you for fixing it so quickly!

    It worked, but I think I stumbled into the error with GridEditor.cs, which has the same issue on line 20

    private int mask = (1 << LayerMask.NameToLayer("WorldLimit"));

    By default when starting the editor into the Level_Desktop scene it seems somehow the grid's become "full", and gives editor errors for GridEditor.cs out when clicking on GridManager in the inspector

    I made the same fix by putting it into OnEnable, and clicking on check heights which seems to have turned them back to yellow

    Edit:
    Another odd issue... On one machine after updating, even though there were no errors anymore, the editor windows wouldn't pop up... I tried modifying the line to be EditorWindow.GetWindow(typeof(EnemySetup)).Show(); which caused it pop up.  Thereafter the other two were able to pop up without even adding the Show() .  But on another machine even adding that didn't allow it to pop up
    Edit 2:
    Seems to be an issue with upgrading Unity's or the saved Layouts getting in a bad state. I followed the advice here to reset layout to factory and restarting unity fixed it.
    http://answers.unity3d.com/questions/1344256/my-editorwindow-wont-display-properly-even-when-co.html



  • Must have missed the GridEditor, although I've opened all editor windows after your report... simply moving the initialization code to OnEnable is the correct solution.

    I've ran into that 'editor window not showing up' issue and a lot of GUI errors in the console myself when fixing them. The cause seems to be that after opening the old window (with the error), it still stays active in the layout somewhere, so even after moving the initialization to OnEnable it is not being reset or reloaded properly. A bad state of the layouts, as you call it. Very strange, but resetting the layout (or removing the script and reimporting it) fixes it indeed.



  • Thank you for the quick support!


Log in to reply