Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request A way to allow making script folder without companion meta files

Discussion in 'Editor & General Support' started by Thaina, Feb 13, 2022.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,158
    While meta file was a useful invention of unity editor. Sometimes we would like to have a pure script or other asset that not really need to have meta file for each file

    I wish unity could add functionality to add some file to be a symbol that, under this folder, there would not need to have meta file and all script files would be included

    Importing a library as script sources then could be simple. And pure script package might be easily imported without the need to remake its meta file in unity

    Maybe adding `.script` empty file to skip the meta generation in that folder, something like that
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I'm not really sure what you feel the burden is of Unity creating .meta files. I do, however, understand the burden of Unity actually importing (and reimporting) certain files that are in the project but which Unity doesn't really need to know about. I'm not sure if that's what you're trying to avoid...? If so, Unity does allow you to place a "~" at the end of a file or directory name, which will prevent Unity from importing that file/directory, and any subdirectories. This is what I use for .blend files, and other files that I want in my project, but which I don't want Unity to import. Of course, this means those files are totally invisible within the Unity editor.

    I'm not sure what happens if you place scripts into a "~" directory, and then try to reference those within Visual Studio. I guess there's a pretty good chance that won't work. But if it does, that would be one way to avoid creating .meta files for those scripts/libraries.
     
    FunctionOverflu likes this.
  3. FunctionOverflu

    FunctionOverflu

    Joined:
    Jul 20, 2015
    Posts:
    7
    Most of the time I don't set the root of my version control (git in my case) repository to Unity project, but instead set it to an upper folder structure. Therefore, I can put scripts/batch files or any other files you don't want them to be tracked by Unity outside the Unity project, but my version control system can still track them.
    Not sure if this will work for your situation though.
     
  4. FunctionOverflu

    FunctionOverflu

    Joined:
    Jul 20, 2015
    Posts:
    7
    Here you can also find the special file/folder naming that dgoyette mentioned
    https://docs.unity3d.com/Manual/SpecialFolders.html
     
  5. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,158
    The burden is on project structure and source control that we need to always add meta file along with the real file

    And as I said. Think about this. Sometimes when we seen a script library project in github. All the scripts needed is already there only to import as UPM git folder. If there was no need to generate meta file I could just fork it and add some `package.json` in github then import as git repo with UPM

    But because unity need to generate meta file. I need to pull it locally, shove that folder into unity, copy it out and push all that back. Then delete the folder. All things tedious and really unnecessary because UPM package don't really changed in anyway. Only reimport the whole repo/path