mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
New Tutorial for unity.md
Daniel George created a fork of a WakaTime Unity plugin that works with the Hackatime API. I modified the instructions for use with this new plugin. I also bolded the links to make them easily visible.
This commit is contained in:
@@ -6,31 +6,51 @@ Let's set up Unity to count how much time you spend making games!
|
||||
|
||||
## Step 1: Make a Hackatime Account
|
||||
|
||||
Go to [Hackatime](https://hackatime.hackclub.com) and make an account. Then log in.
|
||||
Go to **[Hackatime](https://hackatime.hackclub.com)** and make an account. Then log in.
|
||||
|
||||
## Step 2: Get Your Settings Ready
|
||||
|
||||
Click this link to the [setup page](https://hackatime.hackclub.com/my/wakatime_setup). It will set up your account so it works with Unity.
|
||||
Click this link to the **[setup page](https://hackatime.hackclub.com/my/wakatime_setup)**. It will set up your account so it works with Unity.
|
||||
|
||||
## Step 3: Add the Plugin to Unity
|
||||
|
||||
There are a few different Unity plugins. Here's the easiest one:
|
||||
There are a few different Unity plugins. But most of them do not work with the Hackatime API. In light of this, **[Daniel-George](https://github.com/Daniel-Geo)** created a fork of **[Vladfaust's plugin](https://github.com/vladfaust/unity-wakatime)** to work with Hackatime. Here are the instructions:
|
||||
|
||||
1. Open Unity Hub and start a project
|
||||
2. Go to this GitHub page: [Unity WakaTime Plugin](https://github.com/bengsfort/WakaTime-Unity)
|
||||
3. Click the green **Code** button, then **Download ZIP**
|
||||
4. Unzip the file you downloaded
|
||||
5. In Unity, go to **Assets** → **Import Package** → **Custom Package**
|
||||
6. Find the unzipped folder and select the `.unitypackage` file
|
||||
7. Click **Import** on everything
|
||||
2. Go to this GitHub page: **[Unity Hackatime Plugin](https://github.com/Daniel-Geo/unity-hackatime)**
|
||||
3. Copy this text: `https://github.com/daniel-geo/unity-hackatime.git#package`
|
||||
4. Open your Unity project and click on ***Window > Package Management > Package Manager***
|
||||
5. Click the **plus sign** on the top-left-corner of the screen
|
||||
6. Select "**Install package from git URL...**"
|
||||
7. Paste the text you copied earlier
|
||||
8. Click "**Install**"
|
||||
|
||||
After installing, you will need to grab your Hackatime API key and paste it into the Unity plugin:
|
||||
|
||||
1. Open your Unity project
|
||||
2. Go to ***Window > Hackatime***
|
||||
3. Insert your API key into the text field (grab it from the Config File on your settings page: https://hackatime.hackclub.com/my/settings)
|
||||
4. Click "**Save Preferences**"
|
||||
5. **You are done!**
|
||||
|
||||
|
||||
### Hackatime should start tracking these events:
|
||||
|
||||
- DidReloadScripts
|
||||
- EditorApplication.playModeStateChanged
|
||||
- EditorApplication.contextualPropertyMenu
|
||||
- EditorApplication.hierarchyWindowChanged
|
||||
- EditorSceneManager.sceneSaved
|
||||
- EditorSceneManager.sceneOpened
|
||||
- EditorSceneManager.sceneClosing
|
||||
- EditorSceneManager.newSceneCreated
|
||||
|
||||
After installing, the plugin will use your settings from Step 2.
|
||||
|
||||
## If Something Goes Wrong
|
||||
|
||||
**Can't see your time?** Go back to the [setup page](https://hackatime.hackclub.com/my/wakatime_setup) and try again.
|
||||
|
||||
**Plugin not working?** Close Unity and open it again.
|
||||
**Plugin not working?** Close Unity and open it again. Or reinstall it using a different method listed on this page: **[Unity Hackatime Plugin](https://github.com/Daniel-Geo/unity-hackatime)**
|
||||
|
||||
**Package Manager not working?** Make sure you're connected to the internet.
|
||||
|
||||
@@ -39,3 +59,6 @@ After installing, the plugin will use your settings from Step 2.
|
||||
## What Happens Next
|
||||
|
||||
Start making your game! Your time will show up on your [Hackatime page](https://hackatime.hackclub.com) in a few minutes.
|
||||
|
||||
|
||||
**Special thanks to [Daniel-George](https://github.com/Daniel-Geo) for editing the original plugin for use with Hackatime.**
|
||||
|
||||
Reference in New Issue
Block a user