Accessing IdleKit
You can access IdleKit in a couple of different ways depending on which is most convenient for integrating into your project. Both require access to the IdleKit GitHub space. If you do not currently have access, reach out to IdleKit support via Slack or email.
Via GitHub
The various IdleKit repositories are all available on GitHub. You can find them in the following locations:
- IoC: https://github.com/idlekit/idlekit-ioc/
- Logging: https://github.com/idlekit/idlekit-logging/
- Framework: https://github.com/idlekit/idlekit-framework/
- Implementation: https://github.com/idlekit/idlekit-implementation/
- Tools: https://github.com/idlekit/idlekit-tools/
- Examples: https://github.com/idlekit/idlekit-examples/
- Showcase: https://github.com/idlekit/idlekit-showcase/
We enable the ability to fork these repositories into your own GitHub spaces should you wish to access the code and assets in that way.
Note
If you are using GitLab, BitBucket, or any other source control service, we will give you access to the IdleKit repositories via GitHub, and you can mirror these repositories into your own. If this does not work with your workflow, reach out to IdleKit support via Slack or email, and we will find a solution that works best for you.
Via npm
IdleKit is also accessible via npm. The following steps take you through everything that's required to get IdleKit installed.
Note
Make sure that the command prompt that you are running npm from has elevated privileges on Mac or Windows.
- Make sure Unity is closed before starting
- If you have any previous IdleKit packages, delete them from
<repository>/Assets/packages/
- If you don't already have one, create a package.json file in the root of your project:
<repository>/package.json
(a sample file is included inidlekit-showcase
. Update the version tag in the
package.json
"scripts": { "postinstall": "node node_scripts/postinstall.js" }, "dependencies": { "idlekit-framework": "github:Idlekit/idlekit-framework#vN.N.N", "idlekit-implementation": "github:Idlekit/idlekit-implementation#vN.N.N", "idlekit-tools": "github:Idlekit/idlekit-tools#vN.N.N", "idlekit-examples": "github:Idlekit/idlekit-examples#vN.N.N", "idlekit-ioc": "github:Idlekit/idlekit-ioc#vN.N.N", "idlekit-logging": "github:Idlekit/idlekit-logging#vN.N.N" }
#vN.N.N
should be the IdleKit version, this points to a specific tag in Git. See the GitHub releases page for each repo for the lastest version.- If you don't already have them, copy the
node_scripts
folder from theidlekit-showcase
project into the same directory as yourpackage.json
file. These scripts are used during the npm post install process to copy the IdleKit packages into<repository>/Assets/packages/
. If you choose not to use these scripts, you will need to manually copy the IdleKit packages from<repository>/node_modules
. - From the command line, run
npm install
to install the new IdleKit package. This process clones the IdleKit repositories into your project.
Note
If you have blank dropdowns and no options within your ScriptableObject
data assets, right-click on the Project view and select "Re-Import All". This updates the GuidReference
for the data assets.
Troubleshooting
npm installation process results in duplicate node_modules
folders and compile errors
- Ensure that each IdleKit package that your project's package.json file points to are the same version (e.g. v1.0). When pointing to different versions, NPM will fail and result in what appear to be duplicate dependencies.
- If the first step does not resolve the issue, manually remove the duplicate packages from within each IdleKit package located in
<repository>/Assets/packages/
.
npm install freezes on installation of packages
- Make sure you have read access to the repositories specified in the
package.json
- Make sure your device's ssh public key has been added on Github.
npm fails to overwrite existing files on upgrade of IdleKit
- Disable any anti-virus systems (or add an exception for your working directory)
- Clear the npm cache with
npm cache clean
- If the above steps fail to solve the problem, delete the existing IdleKit repositories inside
<repository>/Assets/packages/