Connecting to Google sheets is as simple as setting your API key and your Sheets URL, but first you need to set up your Google Sheet! Compatibility for Google Sheets has been been restricted to only Sheets with the correct format. This is to ensure data is organized in a clear and strongly typed format, and allow for automatic generation of enums and classes.
Follow these steps to create your Google Sheets for GHUD.
Open the template through this link:
https://docs.google.com/spreadsheets/d/1h7XePGLJw0R5hLTGK2g3R7T4NQVa1i6mrgnR3HaO7Qs/template/preview
Click "USE TEMPLATE"
Click "GHUD Template" at the top-left to rename your Google Sheet
Click the blue "Share" button at the top-right
Click the "Restricted" dropdown, and select "Anyone with the link"
Check that the restriction level is set to "Viewer"
Click "Done"
(Optional) Go to https://drive.google.com/drive/u/0/my-drive to organize your Google Sheet in your Google Drive
Here you will learn how to set up the connection between Unity and an already set up Google Sheet.
This section also details how to test this connection.
Go to the Google Sheet you created from the template
Copy the URL from your browser's address bar
In the Unity Project (or File Explorer), open Assets\GHUDatabase\APIKey\GoogleSheetsURL.txt
Replace the entire contents of GoogleSheetsURL.txt with the URL you copied
Save GoogleSheetsURL.txt
This is the procedure for testing the link between your Unity project and your Google Sheet.
It also how you'll update the Unity project with changes to the Google Sheet.
Run the GHUD data collection with the GHUD Menu Item.
From the Unity Editor menu bar, select Tools > GHUD > Data Loading > Get All Data
In the console window, you should see a log message: "Updating all data in Grand Hawk Union Database..."
Wait for the update to finish, then
You should see a completion log message: "Grand Hawk Union Database has been updated..."
Alternatively, updates can be run through the GHUD Window. See the next page for details on the GHUD Window.