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 Assemblies first try problems

Discussion in 'Editor & General Support' started by MikeUpchat, Jul 11, 2023.

  1. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,055
    I have a small project and I am trying to use Assemblies for the first time. My project has scripts in a 'Scripts' folder and there is an 'Editor' folder in there as well that contains editor scripts.

    So I create an Assembly in the Scripts folder, and as I am using TextMeshPro in the scripts I get the usual error so I add Unity.TextMeshPro as a reference and those errors go away, but now I get a load of errors about missing types, but the script for the type is in the Scripts folder:
    Code (CSharp):
    1. Missing types referenced from component CompoMap on game object dialog:
    2.     MyTextures.Layer, Assembly-CSharp (27 objects)
    Am I missing a step, surely if all the script files for the system are in the folder how can it not be finding it, it is all in the same namespace, all in the same folder but I get this error. I must have missed a step somehow but I can't see for the life of me where or how, shouldn't this just work all the scripts are in the folder or sub folder?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Rather than "surely iffing" and "shouldn't this just working" technical systems, start back with the actual documentation for the system(s) you're playing with. Nobody is going to retype it all here for you.

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, log output, variable values, and especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)
     
  3. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,055
    Well thank you Kurt, so here the post with the exact same info but laid out in some specific way for some reason.
    What I Want - I want to make an Assembly of a folder containing script files.
    What I Tried - Creating an Assembly in the folder as laid out in the Assembly Docs.
    What I expected to happen - For the project to not all of a sudden get errors about missing references to classes that are defined in scripts in that folder and to compile and work. But instead get errors about missing types for classes that are defined in script files in the folder the Assembly is in.
    Log Output -
    1. Missing types referenced from component CompoMap on game object dialog:
    2. MyTextures.Layer, Assembly-CSharp (27 objects)
    Links to Docs - https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html

    Is that any better? I don't recall seeing anywhere in any sticky about the strict rules that seem to have suddenly been put in place to ask a simple question, perhaps Kurt you could provide a link for those who like myself have not been lucky enough to find the rules regarding asking a simple question?