Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Help with Assembly definition for the Volvo Vehicle Sample Project

Discussion in 'Scripting' started by TeamDefiant, Jan 16, 2023.

  1. TeamDefiant

    TeamDefiant

    Joined:
    Mar 29, 2017
    Posts:
    50
    Hello, I'm working an a project using the Volvo vehicle sample project, but I'm having trouble accessing a script iv'e created from within one of the sample Volvo scripts.
    I'm trying to change their input system to use the new input system inside of DemoCarController.cs, but I'm getting this good old error message ...
    "Assets\Addins\External\VolvoCars\Scripts\Runtime\Controllers\CarController\DemoCarController.cs(34,30): error CS0246: The type or namespace name 'InputManager' could not be found (are you missing a using directive or an assembly reference?)"


    The file i'm trying to access from within DemoCarController is InputManager, and is located as per the following image.


    I have no idea how these assemble definitions work so could use some help with them please. (Assuming that I even need one, and this can't be fixed another way.)


    I know I could just re-write the Volvo code and put it in the same scripts folder as my code, or but I'd rather not have to do that.

    Thanks in advance. :)
     

    Attached Files:

  2. TeamDefiant

    TeamDefiant

    Joined:
    Mar 29, 2017
    Posts:
    50
    Ok, quick update, I located an asmdef in Assets\Addins\External\VolvoCars\Scripts\Runtime, I added a reference to a new asmdef I created in my scripts folder and everything can see each other. But now I get a cyclic dependencies error.
    One or more cyclic dependencies detected between assemblies: Assembly-CSharp-Editor, Assembly-CSharp, Assets/MainGame/Scripts/MainGameScripts.asmdef, Assets/Addins/External/VolvoCars/Utility/Editor/com.volvocars.public.utility.editor.asmdef, Assets/Addins/External/VolvoCars/Scripts/Runtime/com.volvocars.public.vehicle_fundamentals.asmdef, Assets/Addins/External/VolvoCars/Scripts/Editor/com.volvocars.public.vehicle_fundamentals.editor.asmdef

    I guess I need help with this issue instead now!
     
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,668
    You can't have assembly A reference assembly B, if B references A. This also generalizes to more than 2 assemblies, you can't have A->B->C and then have C->A, since that's an infinite loop: A->B->C->A->B->C->A.... etc.

    Just make sure than your assemblies form a tree-like structure instead of a loop. This might need refactoring your code to ensure there's no cyclic dependency chains.
     
    SF_FrankvHoof likes this.
  4. TeamDefiant

    TeamDefiant

    Joined:
    Mar 29, 2017
    Posts:
    50
    I couldn't be bothered to find out which .asmdef to link to what, so I just deleted them all.

    Problem "solved"

    Maybe one day I'll actually try and figure it out correctly. But I doubt it.
     
    Kurt-Dekker likes this.
  5. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,668
    Just keep in mind that compilation times will likely increase as a result, since the entire project needs to be recompiled after every change now.