Bug Report + Solution: Race Condition in TypePrefs

FlowCanvas Forums Support Bug Report + Solution: Race Condition in TypePrefs

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2820
    joshcamas
    Participant

    I have had an issue pop up every once in a while, where the TypePrefs seemed to initiate before my code has fully compiled, making the TypePrefs unable to find my types.

    The solution is to wrap the initalization in a editor delay call. Even better is to put that in a separate function, so other calls to LoadTypes() is not delayed.

            [InitializeOnLoadMethod]
            static void InitializeLoadTypes()
            {
                EditorApplication.delayCall += LoadTypes;
            }

            static void LoadTypes()
            {
                …Nothing changed here

    http://ardenfall.com

    #2822
    joshcamas
    Participant

    Sadly there is another time this issue can crop up – if there is a script error and you open Unity, none of the scripts outside of the plugins folder will recompile. This causes the types to not be found, and be removed from the list. I will make a separate bug report on this issue.

    http://ardenfall.com

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.