Search Unity

Don't require meta files in packages where they aren't needed

Discussion in 'Package Manager' started by xucian, Feb 7, 2020.

  1. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hey,

    I'm personally forced to transition a common DLL used both on the server and the client to a package because it previously referenced UnityEngine.UI, which is not available anymore.

    I compile the common DLL as usual referencing an old UnityEngine.UI.dll for the server (I need it on the server indirectly - long story), and make the common C# project folder have the structure of a package, i.e. replacing "bin" and "obj" with "bin~" and "obj~" (so they'll be ignored), adding package.json etc. and linking that package into the unity project where my client code resides.

    Currently I'm linking its folder as an embedded package (via symlink to the actual common C# project), which automatically creates the meta files for me, but what I'd like is to not have any meta files inside the package, where they're not needed (and keep the common project clean). For ex., I have no MonoBehaviours in it, so I don't see why meta files would be needed.

    A friendly solution would be to allow meta files if they already exist, but not require them for non-reference-able .cs files.

    @okcompute_unity, @maximeb_unity, do you have any input on this?

    Lucian
     
  2. AskCarol

    AskCarol

    Joined:
    Nov 12, 2019
    Posts:
    234
    I'll pass this along to them and we will circle back when there is an answer!
     
    xucian likes this.
  3. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @thefallengamesstudio

    I don't fully understand your scenario. But, I'll give a shot at answering anyway:). Everything that is exposed/imported through the Asset Database requires a .meta files. This is just how the system works. It could probably be changed, but this is unrelated to the Package Manager. You can ask your question in the Editor & General Support forum. If files don't need to be imported by the AssetDatabase, you can hide them through hidden folder. Prefix your folder with a dot (.) or suffix with a tilda (~) (Ex:
    .hidden-folder
    or
    another-hidden-folder~
    ).

    Hope it helps,

    Pascal