Publisher | Josh Aaron Miller |
---|---|
File size | 546.36kB |
Number of files | 52 |
Latest version | 1.0.3 |
Latest release date | 2022-10-26 08:06:04 |
First release date | 2022-09-13 05:13:16 |
Supported Unity versions | 2018.4.2 or higher |
This package gives you easy access to the entire iNaturalist database and server!
Use it to:
- Add authentic nature sounds to your game
- Add authentic nature photography for flavorful immersion
- Get information about local flora and fauna to make your real-life setting more realistic
- Enable your players to make citizen science contributions to worldwide efforts in biodiversity science
- And more!
This project is not endorsed by iNaturalist, the California Academy of Sciences, or National Geographic. This project is not sponsored by or affiliated with Unity Technologies or its affiliates. “Unity” is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.
Getting Started
- Add this package to your Unity project.
- For any scripts that want to interact with iNaturalist, import this code by adding using JoshAaronMiller.INaturalist; at the top of the file.
- Add an INatManager component to any GameObject, e.g.: INatManager myINatManager = gameObject.AddComponent<INatManager>(); or by adding the component in the Unity editor.
- Use the INatManager to make calls to the API following the documentation, see the examples below.
General Usage Notes
All calls to the INatManager require two parameters: a function to callback when the request returns successfully, and a function to callback when the request fails.
Example:
INatManager iNatManager;
ObservationSearch myObservationSearch;
// ...
public void ProcessObservations(Results<Observations> myObservationResults){
// do stuff
}
public void HandleError(Error error){
// do stuff
}
iNatManager.SearchObservations(myObservationSearch, ProcessObservations, HandleError);
Authentication
The demo authenticates in a way that is simple to program but cumbersome for the user, i.e., by asking the user to copy/paste in their API token. For a production-ready application, you would want to instead use a web viewer to load the iNaturalist login screen within the client. See iNaturalist's recommended means for authenticating, here.
Free web viewers:
For free web viewer packages, I have found these options (this is not an endorsement of any software listed below):
- Windows: https://github.com/tunerok/unity_browser
- Everything else: https://github.com/gree/unity-webview
- Android / iOS: https://assetstore.unity.com/packages/tools/utilities/game-package-manager-147711
Common Use Cases and Examples
Fetch sounds
Why: Your game/project wants to have authentic nature sounds, such as bird calls from real birds of a specific species.
Example: See this project's GitHub page for examples.
Fetch pictures
Why: Your game/project wants to use authentic nature photography for flavorful immersion.
Example: See this project's GitHub page for examples.
Get information about local flora/fauna
Why: Your game/project uses a real-life place and wants to have accurate information about the animals and plants that live in that area.
Example: See this project's GitHub page for examples.
Help classify images or sounds
Why: Your game/project has a real citizen science component where users can submit labels or vote on existing labels.
Example: See this project's GitHub page for examples.
Documentation
See this project's GitHub page for more details, examples, and documentation.
iNaturalist + Unity
The full documentation for this code is available here.
iNaturalist API Documentation
The official iNaturalist API documentation is available here.
Support
For questions or feedback, contact me at josh [at] joshaaronmiller [dot] com