├── .gitignore ├── README.md ├── docs ├── images │ └── heart.png └── npm.md ├── index.js ├── package.json ├── scripts ├── copy.js ├── folders.js └── postinstall.js ├── src └── TEMPLATE │ ├── Source.cs │ └── Source.cs.meta └── test ├── .gitignore ├── Assets ├── Editor.meta ├── Editor │ ├── Tests.meta │ └── Tests │ │ ├── SourceTests.cs │ │ └── SourceTests.cs.meta ├── Plugins.meta ├── pkg-all.meta └── pkg-all │ ├── TEMPLATE.meta │ └── TEMPLATE │ ├── Source.cs │ └── Source.cs.meta ├── Library ├── AnnotationManager ├── EditorUserSettings.asset ├── LibraryFormatVersion.txt ├── ProjectSettings.asset ├── SpriteAtlasDatabase.asset └── TilemapEditorUserSettings.asset ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | obj 3 | Temp 4 | *.suo 5 | *.user 6 | *.pidb 7 | *.userprefs 8 | *.sln 9 | *.csproj 10 | *.swp 11 | 12 | Library/cache 13 | Library/metadata 14 | Library/previews 15 | Library/ScriptAssemblies 16 | Library/assetDatabase3 17 | Library/AssetImportState 18 | Library/assetservercachev3 19 | Library/AssetServerCacheV3 20 | Library/AssetVersioning.db 21 | Library/AudioManager.asset 22 | Library/ShaderCache.db 23 | Library/BuildPlayer.prefs 24 | Library/BuildSettings.asset 25 | Library/DynamicsManager.asset 26 | Library/EditorSettings.asset 27 | Library/EditorUserBuildSettings.asset 28 | Library/expandedItems 29 | Library/FailedAssetImports.txt 30 | Library/guidmapper 31 | Library/InspectorExpandedItems.asset 32 | Library/MonoManager.asset 33 | Library/NetworkManager.asset 34 | Library/ScriptMapper 35 | Library/unity default resources 36 | Library/unity editor resources 37 | Library/ShaderCache/ 38 | Library/shadercompiler-1.log 39 | Library/shadercompiler-64bit-*.log 40 | Library/shadercompiler-32bit-*.log 41 | Library/LastSceneManagerSetup.txt 42 | Library/shadercompiler-* 43 | Library/CurrentLayout.dwlt 44 | .DS_Store 45 | 46 | node_modules 47 | Assets/build 48 | Assets/packages 49 | Assets/pkg-all 50 | Assets/Plugins 51 | Assets/pkg-all.meta 52 | .vscode 53 | Library/CrashedAssetImports.txt 54 | 55 | EditorTestResults.xml 56 | UnityPackageManager 57 | etc 58 | Library 59 | Logs 60 | UserSettings 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TEMPLATE 2 | 3 | ... 4 | 5 | ## Install 6 | 7 | From your unity project folder: 8 | 9 | npm init 10 | npm install --save git+ssh://git@github.com:shadowmint/TEMPLATE.git --no-progress 11 | echo Assets/pkg-all >> .gitignore 12 | echo Assets/pkg-all.meta >> .gitignore 13 | 14 | To avoid typing the password in every time, consider using `ssh-add`. 15 | 16 | The package and all its dependencies will be installed in your Assets/pkg-all folder. 17 | -------------------------------------------------------------------------------- /docs/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/docs/images/heart.png -------------------------------------------------------------------------------- /docs/npm.md: -------------------------------------------------------------------------------- 1 | ![NPM + Unity = <3](https://raw.github.com/shadowmint/unity-package-template/master/docs/images/heart.png) 2 | 3 | ## What? Why? 4 | 5 | C# has a package manager which is already rather good; 6 | [NuGet](https://www.nuget.org/). 7 | 8 | However, it's designed around distributing assemblies, not source code. 9 | 10 | Installing a NuGet package also has a number of side effects; to quote their website: 11 | 12 | >When you install a package, NuGet copies files to your solution and automatically makes whatever changes are needed, such as adding references and changing your app.config or web.config file. If you decide to remove the library, NuGet removes files and reverses whatever changes it made in your project so that no clutter is left. 13 | 14 | Finally, it's [technically complex](http://docs.nuget.org/Create/Creating-and-Publishing-a-Package) to setup. Ultimately, it's not the right tool for Unity. 15 | 16 | Unity [asset bundles](http://docs.unity3d.com/Manual/AssetBundlesIntro.html) basically extract a set of assets and source files directly into your project, but they have some severe limitations: 17 | 18 | - You cannot have an asset bundle with external dependencies. 19 | - Version control with asset bundles is difficult. 20 | 21 | People have [blogged about](http://blog.juiceboxmobile.com/2013/06/19/per-asset-versioning-with-unity-asset-bundles/) the challenges asset bundles pose and various ways to solve them, but this repository is here to demonstrate an alternative solution: NPM. 22 | 23 | ## What's NPM? 24 | 25 | NPM is the node package manager. 26 | 27 | You can read about it in detail at the npm website: 28 | 29 | https://docs.npmjs.com/getting-started/what-is-npm 30 | 31 | It's a fully featured robust package manager for the node ecosystem. 32 | 33 | Probably the first question is almost certainly going to be: 34 | 35 | > ...but, node uses javascript, and I use C# in my project. 36 | 37 | ...which is true, but npm isn't tied to just javascript. People use it to distrubte 38 | styles, images, files and... code in languages other than javascript. It can do a 39 | number of things such as: 40 | 41 | - Distribute source files for any language. 42 | - Compile native targets cross platform for plugins. 43 | - Manage complex version hierarchies of dependencies. 44 | - Use both a central package repository or private source package urls. 45 | 46 | ## Using NPM to install a package 47 | 48 | So, what would installing a package, including it's dependencies look like using npm? 49 | 50 | First you have to configure your project to use npm, using: `npm init` 51 | ``` 52 | Clank:foo doug$ npm init 53 | This utility will walk you through creating a package.json file. 54 | It only covers the most common items, and tries to guess sensible defaults. 55 | 56 | See `npm help json` for definitive documentation on these fields 57 | and exactly what they do. 58 | 59 | Use `npm install --save` afterwards to install a package and 60 | save it as a dependency in the package.json file. 61 | 62 | Press ^C at any time to quit. 63 | name: (foo) 64 | version: (1.0.0) 65 | description: 66 | entry point: (index.js) 67 | test command: 68 | git repository: 69 | keywords: 70 | author: 71 | license: (ISC) 72 | About to write to /Users/doug/dev/unity/foo/package.json: 73 | 74 | { 75 | "name": "foo", 76 | "version": "1.0.0", 77 | "description": "", 78 | "main": "index.js", 79 | "scripts": { 80 | "test": "echo \"Error: no test specified\" && exit 1" 81 | }, 82 | "author": "", 83 | "license": "ISC" 84 | } 85 | 86 | 87 | Is this ok? (yes) 88 | ``` 89 | 90 | Once that's done, install a github package using: `npm install` 91 | 92 | ``` 93 | Clank:foo doug$ npm install --save shadowmint/unity-n-input 94 | 95 | > unity-n-core@0.0.1 postinstall /Users/doug/dev/unity/foo/node_modules/unity-n-core 96 | > node scripts/postinstall.js 97 | 98 | 99 | > unity-n-input@0.0.2 postinstall /Users/doug/dev/unity/foo/node_modules/unity-n-input 100 | > node scripts/postinstall.js 101 | 102 | foo@1.0.0 /Users/doug/dev/unity/foo 103 | └─┬ unity-n-input@0.0.2 (git://github.com/shadowmint/unity-n-input.git#58e81fa6fd53e2c20327018612540757fdecb02f) 104 | ├─┬ mkdirp@0.5.1 105 | │ └── minimist@0.0.8 106 | ├── ncp@2.0.0 107 | └── unity-n-core@0.0.1 (git://github.com/shadowmint/unity-n-core.git#f3e0c4d31e1bb8fd8bf699c8fe06e0e74f459561) 108 | 109 | npm WARN EPACKAGEJSON foo@1.0.0 No description 110 | npm WARN EPACKAGEJSON foo@1.0.0 No repository field. 111 | ``` 112 | 113 | As you can see the `unity-n-input` package installed `unity-n-core` as a dependency; and if you look in the `Assets` folder, you'll see all the C# files: 114 | 115 | ``` 116 | ./Assets/packages/n-core/core/env/Arguments.cs 117 | ./Assets/packages/n-core/core/env/Arguments.cs.meta 118 | ./Assets/packages/n-core/core/env 119 | ./Assets/packages/n-core/core/env.meta 120 | ./Assets/packages/n-core/core/random/Random.cs 121 | ./Assets/packages/n-core/core/random/Random.cs.meta 122 | ./Assets/packages/n-core/core/random 123 | ./Assets/packages/n-core/core/random.meta 124 | ./Assets/packages/n-core/core/reflect/Editor/EnumTests.cs 125 | ./Assets/packages/n-core/core/reflect/Editor/EnumTests.cs.meta 126 | ./Assets/packages/n-core/core/reflect/Editor/PropTests.cs 127 | ./Assets/packages/n-core/core/reflect/Editor/PropTests.cs.meta 128 | ./Assets/packages/n-core/core/reflect/Editor/TypeTests.cs 129 | ./Assets/packages/n-core/core/reflect/Editor/TypeTests.cs.meta 130 | ./Assets/packages/n-core/core/reflect/Editor/ValidatorTests.cs 131 | ./Assets/packages/n-core/core/reflect/Editor/ValidatorTests.cs.meta 132 | ./Assets/packages/n-input/controller/ControllerConfig.cs 133 | ./Assets/packages/n-input/controller/ControllerConfig.cs.meta 134 | ... 135 | ``` 136 | 137 | Notice that npm supports a [variety of remote urls](https://docs.npmjs.com/files/package.json#urls-as-dependencies), including private packages over ssh and dependencies on local folders. 138 | 139 | It's robust, battle tested and works cross platform; basically a great solution for managing packages for Unity. :) 140 | 141 | ## How do you write an NPM package? 142 | 143 | So... what about writing a new package? 144 | 145 | Pretty simple, add a `package.json` to your repository. 146 | 147 | Here's what it looks like: 148 | 149 | ``` 150 | { 151 | "name": "unity-TEMPLATE", <-- Your package's name 152 | "version": "0.0.1", <-- Semantic version number 153 | "description": "...", 154 | "main": "index.js", 155 | "repository": { 156 | "type": "git", 157 | "url": "..." 158 | }, 159 | "files": [ <--- List of files to download and install 160 | "index.js", 161 | "scripts", 162 | "src" 163 | ], 164 | "author": "...", 165 | "license": "MIT", 166 | "bugs": { 167 | "url": "..." 168 | }, 169 | "homepage": "...", 170 | "scripts": { <-- Install script, build script, etc. 171 | "postinstall": "node scripts/postinstall.js" 172 | }, 173 | "dependencies": { <-- Dependencies for this package, by version 174 | "ncp": "^2.0.0", 175 | "mkdirp": "^0.5.1", 176 | "unity-n-input": "github:shadowmint/unity-n-input#0.0.1" 177 | } 178 | } 179 | ``` 180 | 181 | The `package.json` format is completely and comprehensively documented here: 182 | 183 | https://docs.npmjs.com/files/package.json 184 | 185 | Notice that in this case the package dependency is just pointing to a github url, not a published npm package. Personally I'm not sure how I feel about publishing C# packages on the npm registry; it *is* for javascript, and explicit remote urls work just fine, but that your pick. 186 | 187 | Certainly `npm install my-unity-package --save` is easier to do than: 188 | 189 | `npm install --save git+ssh://me@myserver.com:~/unity-packages/animation.git` 190 | 191 | ...but with the latter you can use private repositories, while npm registry private repositories are a [paid feature](https://www.npmjs.com/private-modules). Still, npm is flexible enough to use it however you want. 192 | 193 | ### That Assets folder... 194 | 195 | Notice in the `package.json` above there is a 'postinstall' script. This is a script that gets invoked after a package has completely finished installing, and is useful in some cases where you need to copy files around and so forth. 196 | 197 | Turns out that with Unity packages that's something you do want; because by default packages are installed into `node_modules` and not into the `Assets` folder. 198 | 199 | So you add a little helper script to run after the local install into `node_modules` is complete: 200 | 201 | ``` 202 | var mkdirp = require('mkdirp'); 203 | var path = require('path'); 204 | var ncp = require('ncp'); 205 | 206 | // Paths 207 | var src = path.join(__dirname, '..', 'src'); 208 | var dir = path.join(__dirname, '..', '..', '..', 'Assets', 'packages'); 209 | 210 | // Create folder if missing 211 | mkdirp(dir, function (err) { 212 | if (err) { 213 | console.error(err) 214 | process.exit(1); 215 | } 216 | 217 | // Copy files 218 | ncp(src, dir, function (err) { 219 | if (err) { 220 | console.error(err); 221 | process.exit(1); 222 | } 223 | }); 224 | }); 225 | ``` 226 | 227 | Now, this *is* javascript, and although it doesn't have to be, if you're writing an npm package, it's probably best to stick with it. 228 | 229 | However, it is simple enough that I don't think it's any real concern to manage; create the `Assets/packages` folder if it doesn't exist, and then recursively copy all of the files in `src` from this repository into it. 230 | 231 | That's basically what a normal asset bundle does. 232 | 233 | In this case it's best to also add the `Assets/packages` (or whatever folder you install into), to your ignore file, otherwise next time you run npm install it'll overwrite all those files again. 234 | 235 | ## Putting it all together 236 | 237 | So, finally, all the parts all working together can be found here, as an easy to use template for writing a new package: 238 | 239 | https://github.com/shadowmint/unity-package-template 240 | 241 | Search for 'TEMPLATE' in the package and replace the various instances and you're good to go. 242 | 243 | Not that keen to use a template? 244 | 245 | You can also port any existing package over as well, just by adding a few extra files. You can see the excellent FullSerializer package by Jacob Dufault turned into an npm package by this one simple and [non-intrusive commit](https://github.com/shadowmint/fullserializer/commit/b06fedad2a50f90c66ddf20dc394b042d8db8053). 246 | 247 | Now using FullSeriailizer is as simple as: 248 | 249 | `npm install --save shadowmint/fullserializer` 250 | 251 | Tell me that isn't just darn cool. 252 | 253 | <3 NPM. 254 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = function() { throw new Error('Not a javascript module'); }; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unity-TEMPLATE", 3 | "version": "0.0.1", 4 | "description": "TEMPLATE", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/shadowmint/unity-TEMPLATE.git" 9 | }, 10 | "files": [ 11 | "index.js", 12 | "scripts", 13 | "src" 14 | ], 15 | "author": "douglas.linder@gmail.com", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/shadowmint/unity-TEMPLATE/issues" 19 | }, 20 | "homepage": "https://github.com/shadowmint/unity-TEMPLATE", 21 | "scripts": { 22 | "postinstall": "node scripts/postinstall.js" 23 | }, 24 | "dependencies": { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /scripts/copy.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | /** Log debug messages to the console? */ 5 | const DEBUG = true; 6 | 7 | function copy(src, dest) { 8 | return new Promise((resolve, reject) => { 9 | walkFind(src).then((list) => { 10 | mkdir(dest).then(() => { 11 | walkCopy(src, dest, list).then(resolve, reject); 12 | }, reject); 13 | }, reject); 14 | }); 15 | } 16 | 17 | function walkFind(src) { 18 | trace('explore: ' + src); 19 | let data = {pending: [src], busy: 0, dirs: [], files: [], error: null}; 20 | return new Promise((resolve, reject) => { 21 | let step = () => { 22 | if (data.error) { 23 | reject(data.error); 24 | } 25 | else if (data.busy || data.pending.length) { 26 | walkFindFSM(src, data, step); 27 | } 28 | else { 29 | resolve(data); 30 | } 31 | }; 32 | walkFindFSM(src, data, step); 33 | }); 34 | } 35 | 36 | function walkFindFSM(root, data, step) { 37 | let doStep = () => setTimeout(step, 1); 38 | let aborted = false; 39 | 40 | // Busy waiting 41 | if (!data.pending.length) { 42 | setTimeout(doStep, 1000); 43 | return; 44 | } 45 | 46 | let dir = data.pending.shift(); 47 | let dirShort = dir.substr(root.length + 1); 48 | data.busy += 1; 49 | trace("- Folder: " + dirShort); 50 | fs.readdir(dir, (err, list) => { 51 | if (aborted) return; 52 | if (err) { 53 | data.error = err; 54 | aborted = true; 55 | doStep(); 56 | return; 57 | } 58 | 59 | // No files, skip 60 | if (list.length === 0) { 61 | data.busy -= 1; 62 | doStep(); 63 | return; 64 | } 65 | 66 | // Check each file and process it 67 | let resolved = 0; 68 | for (let i = 0; i < list.length; i++) { 69 | let here = path.join(dir, list[i]); 70 | let hereShort = here.substr(root.length + 1); 71 | trace("-- File: " + hereShort); 72 | fs.stat(here, (err, stat) => { 73 | if (aborted) return; 74 | if (err) { 75 | aborted = true; 76 | data.error = err; 77 | doStep(); 78 | return; 79 | } 80 | if (stat.isDirectory()) { 81 | data.pending.push(here); 82 | } 83 | else { 84 | data.files.push(hereShort); 85 | } 86 | resolved += 1; 87 | if (resolved === list.length) { 88 | data.busy -= 1; 89 | let shortname = dir.substr(root.length + 1, dir.length); 90 | data.dirs.push(shortname); 91 | trace("- Finished: " + hereShort); 92 | doStep(); 93 | } 94 | }); 95 | } 96 | }); 97 | } 98 | 99 | function walkCopy(root, dest, data) { 100 | return new Promise((resolve, reject) => { 101 | let folderCount = 0; 102 | let fileCount = 0; 103 | let folders = data.dirs.map(i => path.join(dest, i)); 104 | let files = data.files.map(i => [path.join(root, i), path.join(dest, i)]); 105 | let error = null; 106 | trace("Copy to: " + dest); 107 | let continueWithCopy = (path) => { 108 | folderCount += 1; 109 | trace("mkdir: (" + folderCount + "/" + folders.length + ") " + path); 110 | if (error) { 111 | reject(error); 112 | } 113 | if (folderCount === folders.length) { 114 | files.map(i => copyFile(i).then(() => finishedCopy(i), (err) => { 115 | error = err; 116 | })); 117 | } 118 | }; 119 | let finishedCopy = (path) => { 120 | fileCount += 1; 121 | trace(" copy: (" + fileCount + "/" + files.length + ") " + path[1]); 122 | if (error) { 123 | reject(error); 124 | } 125 | if (fileCount === files.length) { 126 | resolve({folders: folders, files: files.map(i => i[1])}); 127 | } 128 | }; 129 | folders.map(i => mkdir(i).then(() => continueWithCopy(i), (err) => { 130 | error = err; 131 | })); 132 | }); 133 | } 134 | 135 | function copyFile(paths) { 136 | const src = paths[0]; 137 | const dest = paths[1]; 138 | return new Promise((resolve, reject) => { 139 | try { 140 | let copyResult = (err) => { 141 | if (err) reject(err); 142 | resolve(); 143 | }; 144 | if (fs.copyFile) { 145 | fs.copyFile(src, dest, copyResult); 146 | } 147 | else { 148 | copyFileFallback(src, dest, copyResult); 149 | } 150 | } 151 | catch (err) { 152 | reject(err); 153 | } 154 | }); 155 | } 156 | 157 | function copyFileFallback(source, target, cb) { 158 | let cbCalled = false; 159 | let rd = fs.createReadStream(source); 160 | rd.on("error", function (err) { 161 | done(err); 162 | }); 163 | let wr = fs.createWriteStream(target); 164 | wr.on("error", function (err) { 165 | done(err); 166 | }); 167 | wr.on("close", function (ex) { 168 | done(); 169 | }); 170 | rd.pipe(wr); 171 | 172 | function done(err) { 173 | if (!cbCalled) { 174 | cb(err); 175 | cbCalled = true; 176 | } 177 | } 178 | } 179 | 180 | function mkdir(target) { 181 | return new Promise((resolve, reject) => { 182 | setTimeout(() => { 183 | try { 184 | let parts = target.split(path.sep); 185 | parts[0] = '/'; // Split and recombine on absolute paths doesn't work. 186 | let partial = ''; 187 | for (let i = 0; i < parts.length; i++) { 188 | partial = path.resolve(path.join(partial, parts[i])); 189 | if (!fs.existsSync(partial)) { 190 | fs.mkdirSync(partial); 191 | } 192 | } 193 | resolve(); 194 | } 195 | catch (err) { 196 | reject(err); 197 | } 198 | }, 1); 199 | }); 200 | } 201 | 202 | function trace(message) { 203 | if (DEBUG) { 204 | console.log(message); 205 | } 206 | } 207 | 208 | module.exports = { 209 | copy: copy 210 | }; 211 | -------------------------------------------------------------------------------- /scripts/folders.js: -------------------------------------------------------------------------------- 1 | let path = require('path'); 2 | let fs = require('fs'); 3 | 4 | /** 5 | * In node 5.4+ INIT_CWD is the initial path with npm has been executed for various install and script hooks. 6 | * Extract that value and fix it if its wrong for some reason (eg. git bash) 7 | */ 8 | function getInitCwd() { 9 | let root = process.env.INIT_CWD; 10 | if (!root) { 11 | throw new Error('Missing INIT_CWD env variable. Run using npm >= 5.4 or use INIT_CWD=`pwd` npm install to manually specify the root folder'); 12 | } 13 | 14 | // Git bash uses /c/... style folder paths, but we need proper ones for the install script. 15 | const isFail = /^win/.test(process.platform); 16 | if (/^\/c\//.test(root) && isFail) { 17 | root = root.substr('/c'.length); 18 | } 19 | 20 | root = path.resolve(root); 21 | 22 | if (!fs.existsSync(root)) { 23 | throw new Error('Invalid INIT_CWD: No such path: ' + root); 24 | } 25 | 26 | return root; 27 | } 28 | 29 | module.exports = { 30 | getInitCwd: getInitCwd 31 | }; 32 | -------------------------------------------------------------------------------- /scripts/postinstall.js: -------------------------------------------------------------------------------- 1 | let path = require('path'); 2 | let fs = require('fs'); 3 | let copy = require('./copy'); 4 | let folders = require('./folders'); 5 | 6 | // Exit vars 7 | let done = false; 8 | 9 | // Paths 10 | let root = folders.getInitCwd(); 11 | let src = path.join(__dirname, '..', 'src'); 12 | let pkg = path.join(root, 'Assets', 'pkg-all'); 13 | let isModule = fs.existsSync(path.join(root, 'package.json')); 14 | 15 | // Create folder if missing 16 | if (isModule) { 17 | copy.copy(src, pkg).then(() => { 18 | done = true; 19 | }, (err) => { 20 | console.error(err); 21 | process.exit(1); 22 | }); 23 | } else { 24 | console.log('Skip install, not a project: ' + root); 25 | done = true; 26 | } 27 | 28 | (function wait() { 29 | if (!done) setTimeout(wait, 100); 30 | })(); 31 | -------------------------------------------------------------------------------- /src/TEMPLATE/Source.cs: -------------------------------------------------------------------------------- 1 | namespace TEMPLATE 2 | { 3 | public class Source 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/TEMPLATE/Source.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 036cfcf52eb3a41418a38b83183dd982 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | obj 3 | Temp 4 | *.suo 5 | *.user 6 | *.pidb 7 | *.userprefs 8 | *.sln 9 | *.csproj 10 | *.swp 11 | 12 | Library/cache 13 | Library/metadata 14 | Library/previews 15 | Library/ScriptAssemblies 16 | Library/assetDatabase3 17 | Library/AssetImportState 18 | Library/assetservercachev3 19 | Library/AssetServerCacheV3 20 | Library/AssetVersioning.db 21 | Library/AudioManager.asset 22 | Library/ShaderCache.db 23 | Library/BuildPlayer.prefs 24 | Library/BuildSettings.asset 25 | Library/DynamicsManager.asset 26 | Library/EditorSettings.asset 27 | Library/EditorUserBuildSettings.asset 28 | Library/expandedItems 29 | Library/FailedAssetImports.txt 30 | Library/guidmapper 31 | Library/InspectorExpandedItems.asset 32 | Library/MonoManager.asset 33 | Library/NetworkManager.asset 34 | Library/ScriptMapper 35 | Library/unity default resources 36 | Library/unity editor resources 37 | Library/ShaderCache/ 38 | Library/shadercompiler-1.log 39 | Library/shadercompiler-64bit-*.log 40 | Library/shadercompiler-32bit-*.log 41 | Library/LastSceneManagerSetup.txt 42 | Library/shadercompiler-* 43 | Library/CurrentLayout.dwlt 44 | .DS_Store 45 | 46 | node_modules 47 | Assets/build 48 | Assets/pkg-all 49 | Assets/Plugins 50 | Assets/pkg-all.meta 51 | .vscode 52 | Library/CrashedAssetImports.txt 53 | 54 | EditorTestResults.xml 55 | UnityPackageManager 56 | etc 57 | Library 58 | Logs 59 | -------------------------------------------------------------------------------- /test/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e71d988a5831a429987ab791a5867ca6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /test/Assets/Editor/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebd473fa6f98d46268f3f9c15e117c72 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /test/Assets/Editor/Tests/SourceTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using TEMPLATE; 3 | 4 | namespace Tests.TEMPLATE 5 | { 6 | public class SourceTests 7 | { 8 | [Test] 9 | public void test_thing() 10 | { 11 | new Source(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /test/Assets/Editor/Tests/SourceTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60b0087638cbe452c9f6f03438be065d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /test/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c66e2640258254f3cb2558ca296fe6c9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /test/Assets/pkg-all.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f03dc7d3e85534e52a949b43108412f5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /test/Assets/pkg-all/TEMPLATE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60a1b4428d2b2411e8fe061007f827e1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /test/Assets/pkg-all/TEMPLATE/Source.cs: -------------------------------------------------------------------------------- 1 | namespace TEMPLATE 2 | { 3 | public class Source 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/Assets/pkg-all/TEMPLATE/Source.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 036cfcf52eb3a41418a38b83183dd982 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /test/Library/AnnotationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/Library/AnnotationManager -------------------------------------------------------------------------------- /test/Library/EditorUserSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/Library/EditorUserSettings.asset -------------------------------------------------------------------------------- /test/Library/LibraryFormatVersion.txt: -------------------------------------------------------------------------------- 1 | unityRebuildLibraryVersion: 11 2 | unityForwardCompatibleVersion: 40 3 | -------------------------------------------------------------------------------- /test/Library/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/Library/ProjectSettings.asset -------------------------------------------------------------------------------- /test/Library/SpriteAtlasDatabase.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/Library/SpriteAtlasDatabase.asset -------------------------------------------------------------------------------- /test/Library/TilemapEditorUserSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/Library/TilemapEditorUserSettings.asset -------------------------------------------------------------------------------- /test/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "2.0.16", 5 | "com.unity.package-manager-ui": "1.9.11", 6 | "com.unity.purchasing": "2.0.3", 7 | "com.unity.textmeshpro": "1.2.4", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /test/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/PresetManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.3.0f2 2 | -------------------------------------------------------------------------------- /test/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /test/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /test/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadowmint/unity-package-template/e3c574f31321afc74b7717ac28efcd31cfa1b05c/test/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tests", 3 | "version": "0.0.1", 4 | "description": "", 5 | "author": "", 6 | "license": "MIT", 7 | "dependencies": { 8 | "unity-TEMPLATE": "file:..", 9 | "unity-n-tests": "github:shadowmint/unity-n-tests" 10 | } 11 | } 12 | --------------------------------------------------------------------------------