Search Unity

Bug 1.7.7 Assemblies not detected correctly at Codebase initialization

Discussion in 'Visual Scripting' started by PigarsThomas, Apr 27, 2022.

  1. PigarsThomas

    PigarsThomas

    Joined:
    Oct 4, 2018
    Posts:
    1
    If any source code in your assembly is using UnityEditor (or UnityEditorInternal etc), codebase will detect that it is Editor Assembly. Therefore it will not generate any nodes and you cannot find them in node list.

    Temporary solution is adding your assembly in CodeBase.cs:
    Code (CSharp):
    1. private static bool IsUserAssembly(AssemblyName assemblyName)
    2. {
    3.     var name = assemblyName.Name;
    4.  
    5.     return
    6.         name == "Assembly-CSharp" ||
    7.         name == "Assembly-CSharp-firstpass" ||
    8.         name == "YourAssembly";
    9. }
    10.  
     
  2. marcuslelus

    marcuslelus

    Joined:
    Jun 18, 2018
    Posts:
    67
    I made a similar post regarding this issue and provided a tool to check if your code is actually generated.

    Note: If you need to modify the IsUserAssembly method, you'll have to extract the package, otherwise, it's gonna be overridden when Unity compiles.
    • In Library\PackageCache, copy com.unity.visualscripting@1.7.7, paste it in your root folder
    • Remove Visual Scripting from your manifest.json (or remove it using the Package Manager)
    • Then follow this doc.
    Once this is done, you should have something like this in your manifest.json:
    Code (CSharp):
    1.     "com.unity.visualscripting": "file:../com.unity.visualscripting@1.7.7",
    Now you can modify it freely. You won't receive further update, but at least, it will detect your assembly. Check here frequently to check if there's an update available
     
    PigarsThomas likes this.
  3. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    91
    Thank you so much for this, I can confirm this works. I basically had to add every assembly I had in my visual scripting preferences, but once I did it works as expected on iOS. This fix works until it gets patched.... was very frustrating.