Giter VIP home page Giter VIP logo

Comments (7)

AdamRamberg avatar AdamRamberg commented on May 27, 2024

Have just heard whispers of this before, didn't know that it was possible to use a package.json. Being a web dev I love this 😺

Hope you don't mind, but will try to implement this myself. Think it is important to know what is going on. If successful I will commit the changes to v1.0.0. I'm using the library in my current game, so I also want to make sure that I will be able to migrate to this new structure.

Do you know the workflow for when developing a package like this? It's not possible to open the repository directly in Unity, so I guess you would need a test Unity project where you in your manifest point to your local version of the library. Or any other ideas? Just realized that it might me a good idea to have a Unity project inside the repo, but not at the top level and that is not included in the package itself 🤔

from unity-atoms.

soraphis avatar soraphis commented on May 27, 2024

What I've done: (btw if you start with an empty project this is much easier, because you can just git init inside the Assets folder)
I moved the whole project folder inside a new folder "unity-atoms-wrapper" and inside the subfolder "Assets". so for unity the new project will be the wrapper, while the git repository is inside the Assets folder.

Then i moved everything that isn't a source file (e.g. the ProjectSettings folder, ...) into the wrapper directory.
I also removed the UnityAtoms folder inside Assets, because it is an unnecessary nesting.

I moved the Editor folder and Tests, Examples folder to the Assets folder and Everything else into an Source folder.

and i used the package.json to only include Editor, Source and License files. since i would not want to be examples or tests in a package.
Also i added assembly definitions for all the specific folders.


On a new Project:

  • Unity Project Folder
    • Unity Folders like Library, Packages, ProjectSettings, ...
    • Assets
      • (git init here, also .gitignore and .gitattributes if needed)
      • Editor
        • *.asmdef for editor stuff
      • Tests
        • *.asmdef for test stuff
      • Source
      • *.asmdef for the entire package
      • LICENSE
      • README (since this is the git projects root)
      • package.json

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

Implemented in this commit: a3ea1a1

Think it is better to have an example Unity project as a subfolder of the repo in order to work on the library. Of course this project will be excluded from the package. Will create a new issue for adding the project.

from unity-atoms.

soraphis avatar soraphis commented on May 27, 2024

Think it is better to have an example Unity project as a subfolder of the repo in order to work on the library.

yeah, in my fork i did not delete the examples, i just excluded them from the package, they are still in git

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

Did you manage to exclude folders in the package.json file? Seems like Unity's package manager is ignoring what I add to the "files" array in the package.json

from unity-atoms.

soraphis avatar soraphis commented on May 27, 2024

with my fork, in Unity 2018.3.7f1:

grafik

some of the package.json features are ignored by unity, even more so in older versions

if i add this to the package manager:

"com.mambojambostudios.unityatoms": "https://github.com/AdamRamberg/unity-atoms.git#a3ea1a1",

it works fine, too (same structure as in the image above, but its definitely your repo because i refactored my fork to a very different folder structure).

note that the last part after the # is an identifier, if you name your branches and your tags the same i don't know how that is resolved. (because you have a branch "v1.0.0" and at somepoint there might also be a tag "v.1.0.0").

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

Hmm alright. Might be that I add Unity Atoms as a local file instead of via the github repo URL. Will have to fiddle around a little bit more.

from unity-atoms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.