This package contains the SDK for Crittr's API in Unity.
Currently in Beta and not available on the asset store. Will publish when a major release is ready
-
Use the Github url for the master branch, or the latest release found in the releases tab.
-
Follow the instructions from the official Unity documentation to install the SDK.
-
Clone or download and extract the repository to a local folder (e.g.
C:\Downloads\Crittr\unity-sdk
). -
Open up Unity using an exising project or create a new one.
- In Unity, open the package manager (
Window > Package Manager
) - From the package manager, click the
+
icon on the top left and select the optionAdd package from disk...
- Navigate to the downloaded repository and select the
package.json
file. (e.g.C:\Downloads\Crittr\unity-sdk\package.json
) - Open the
package.json
file and the SDK should install.
- In Unity, open the package manager (
CrittrReporter and CrittrCanvas prefabs exist in the Assets/Prefabs
directory to help send your first report. CrittrReporter sends the reports, whereas CrittrCanvas displays the manual reports UI.
-
Add the CrittrReporter prefab to your Scene.
-
Add the Connection URI to the CrittrReporter prefab:
- Scroll to the CrittrSDK script.
- Input the Connection URI for your project (you can find this in the project settings SDK section on Crittr's dashboard)
-
Check the
Send Automatic Reports
in the CrittrSDK script Options. -
Run your game and throw an exception.
- If you get a log message with a location to your report on the dashboard, your report has been sent successfully. Go to the Crittr dashboard to see the report.
- If you got a log error, check that you have entered a valid connection uri.
-
Add the CrittrReporter and CrittrCanvas prefabs to your Scene as game objects.
-
Add the Connection URI to the CrittrReporter game object:
- Scroll to the CrittrSDK script.
- Input the Connection URI for your project (you can find this in the project settings SDK section on Crittr's dashboard)
-
In the CrittrReporter game objects's CrittrSDK script, add the CrittrCanvas game object from your Scene to the following report lifecycle events:
- On Show Form, select the
CrittrUIManager -> HandleShowForm
function. - On Report Success, select the
CrittrUIManager -> HandleShowSuccess
function. - On Report Failure, select the
CrittrUIManager -> HandleShowFailure
function.
- On Show Form, select the
-
In the CrittrCanvas game object, scroll to the Crittr UI Manager script. Add the CrittrReporter game object to the Crittr Reporter selection.
-
Run your game and then press
F8
. A screenshot of your game will be taken and a success screen should pop up with a link and QR code to update your report.- If a screen does not pop up, check the logs to see if you have inputted the connection uri correctly.
- If the failure screen shows, check that you have a valid connection uri.
-
Navigate to the report using the QR code or link, then edit it with a new title and description.
-
That's it! You should be able to see a screenshot and the report in the reports list of the project.