I've made countless Unity projects and prototypes over the years. Recently I decided to comb through them and pick out parts that I would like to reuse in newer projects. To do this i created a new Unity empty project with no dependencies. I decided on a namespace for my framework and pasted the code snippets I wanted to reuse.
I used the following file structure:
Assets/
package.json
- Runtime (All runtime scripts are in this folder)
- Editor (All editor scripts are in this folder) The content in the package file is as follows:
{
"name": "com.simondtd.springboard",
"version": "0.0.1",
"displayName": "Springboard",
"description": "A way to kickstart your project",
"unity": "2024.2",
"author": {
"name": "Simon Hesjevik",
"email": "[email protected]",
"url": "https://simonh.dev"
}
}
I also had to add two assemby definitions, one for the Runtime namespace and one for the Editor namespace. Except for specifying the namespaces, the only thing I had to do was to include the Editor only in the editor assemby definitions platform matrix.
I then pushed this to a new GitHub repo and created a release.
To use this