### Install ARCore Extensions Package Source: https://github.com/augg-io/documentation/blob/main/Setting_up_Example_project.md Guide for installing the official ARCore Extensions package from Google. This process involves using the Package Manager and following external documentation for specific version requirements and dependency management. ```csharp 1. In the top bar select Window - Package Manager 2. Click the + button in the top right corner and select install package from tarball. 3. Follow this tutorial: https://developers.google.com/ar/develop/unity-arf/getting-started-extensions?ar_foundations_version=4#install_arcore - Choose ARFoundation 5+ version - If External Dependency Manager is installed, download a version without EDM4U to avoid conflicts. ``` -------------------------------- ### Local Development Setup Source: https://github.com/augg-io/documentation/blob/main/README.md Instructions for setting up and running the augg.io documentation locally. This involves installing Ruby and Bundler, installing dependencies, and starting the local server. ```bash bundle install bundle exec jekyll serve ``` -------------------------------- ### Install augg.io SDK via Tarball Source: https://github.com/augg-io/documentation/blob/main/Setting_up_Example_project.md Instructions for installing the augg.io SDK package into a Unity project using a tarball file. This involves using the Package Manager and selecting 'Install package from tarball'. ```csharp 1. In the top bar select Window - Package Manager 2. Click the + button in the top right corner and select install package from tarball. 3. Find the path to augg.io SDK tarball (tar.gz file extensions) and install into the project. ``` -------------------------------- ### Plugin Basics: Importing and Tracking Content Source: https://github.com/augg-io/documentation/blob/main/03_start_using_auggio.md Guide on importing content from the augg.io server into Unity and setting up 'AuggioObjects' for content tracking and repositioning. ```Unity 1. Select the experience you want to import into unity. 2. Click download meshes 3. After the meshes get downloaded click Import scene from server 4. If you want your content to be tracked it has to be parented below an GameObject representing **AuggioObject**. Its name will look like this [Object] ObjectName. 5. To be able to reposition content without building a new app each time. Don't move with MyContent but move with **AuggioObject** (name starts with [Object]) 6. If you move the object make sure to push the changes to the server otherwise the new position won't be seen in the build. ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Steps to clone the documentation repository and install necessary Ruby dependencies using Bundler. ```bash git clone https://github.com/your-username/your-repo.git cd your-repo bundle install ``` -------------------------------- ### Unity Package Manager Installation Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Demonstrates installing packages via Unity's Package Manager, including Universal RP, AR Foundation, ARCore XR Plugin, ARKit XR Plugin, and installing from a tarball. ```Unity CLI unityPackageInstaller --package "com.unity.render-pipelines.universal" unityPackageInstaller --package "com.unity.xr.arfoundation" unityPackageInstaller --package "com.unity.xr.arcore" unityPackageInstaller --package "com.unity.xr.arkit" unityPackageInstaller --tarball "/path/to/arcore_extensions.tar.gz" unityPackageInstaller --tarball "/path/to/augg_io_sdk.tar.gz" ``` -------------------------------- ### Basic Dependency Injection Example Source: https://github.com/augg-io/documentation/blob/main/auggio_Tools/Dependency_Injector_Manual.md Demonstrates how to use the [Injected] attribute to inject a service into a MonoBehaviour and perform injection in the Start() method. ```csharp [Bean] public class MyService { public void DoSomething() { } } public class MyComponent : MonoBehaviour { [Injected] private MyService myService; void Start() { Injector.Instance.Inject(this); } } ``` -------------------------------- ### Augg.io Application Token Setup Source: https://github.com/augg-io/documentation/blob/main/01_setting_up_auggio_in_a_project.md Instructions for creating an augg.io application, downloading its token, and placing it in the Unity project. ```unity 1. Create an account at cms.augg.io or in the scanning application. 2. Create a Blank Application in CMS. 3. Open the new application. 4. Click the three dots in the right corner and select **Download App Token**. 5. Place the downloaded application token file inside the **Assets/Resources** folder. 6. Ensure the file is named **auggioFileToken.json**. ``` ```json { "appToken": "YOUR_APP_TOKEN_HERE" } ``` -------------------------------- ### Upgrading ARCoreExtensions in the project Source: https://github.com/augg-io/documentation/blob/main/Setting_up_Example_project.md Information on how to upgrade the ARCoreExtensions package to resolve potential issues with building applications for iOS 18. This involves following a specific tutorial for upgrading the package. ```csharp If you installed an older version of ARCoreExtensions (e.g. 1.39 which is shipped with some earlier versions of augg.io) you may have a problem with building the application to iOS 18. To resolve this issue, upgrade to a newer version of ARCoreExtensions by following this tutorial [Upgrading ARCoreExtensions in the project](https://your-project-url/guides/upgrading_arcore_extensions/). ``` -------------------------------- ### Login to Editor Plugin Source: https://github.com/augg-io/documentation/blob/main/03_start_using_auggio.md Steps to log into the augg.io Editor Plugin by obtaining and entering an API key from the augg.io CMS. ```Unity 1. In Unity in the top bar click on **augg.io** -> **Editor Plugin** 2. Go to **cms.augg.io** 3. Click on profile and select Settings 4. Copy the API key 5. Enter the API key into the plugin. ``` -------------------------------- ### Unity Scene Setup for AR Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Sets up the Unity scene with AR Session, XR Origin (Mobile AR), and ARAnchorManager. ```Unity Editor Script GameObject arSession = new GameObject("AR Session"); arSession.AddComponent(); GameObject xrOrigin = new GameObject("XR Origin (Mobile AR)"); xrOrigin.AddComponent(); xrOrigin.AddComponent(); ``` -------------------------------- ### Unity URP Renderer Feature Setup Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Adds the ARBackgroundRendererFeature to the URP-HighFidelity-Renderer asset in Unity. ```Unity Editor Script var rendererAsset = AssetDatabase.LoadAssetAtPath("Assets/Settings/URP-HighFidelity-Renderer.asset"); var rendererFeatures = rendererAsset.GetFieldValue>("m_RendererFeatures"); var arBackgroundFeature = AssetDatabase.LoadAssetAtPath("Assets/Path/To/ARBackgroundRendererFeature.asset"); rendererFeatures.Add(arBackgroundFeature); AssetDatabase.SaveAssets(); ``` -------------------------------- ### Unity ARCore Extensions Setup Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Configures ARCore Extensions in the Unity scene, including setting up the ARCore Extensions component and creating ARCoreExtensionsConfig and CameraConfigFilter assets. ```Unity Editor Script GameObject arCoreExtensions = new GameObject("ARCore Extensions"); arCoreExtensions.AddComponent(); var arCoreExtensionsConfig = ScriptableObject.CreateInstance(); AssetDatabase.CreateAsset(arCoreExtensionsConfig, "Assets/Settings/ARCoreExtensionsConfig.asset"); var cameraConfigFilter = ScriptableObject.CreateInstance(); AssetDatabase.CreateAsset(cameraConfigFilter, "Assets/Settings/CameraConfigFilter.asset"); var arCoreExtensionsComponent = arCoreExtensions.GetComponent(); arCoreExtensionsComponent.arCoreExtensionsConfig = arCoreExtensionsConfig; arCoreExtensionsComponent.cameraConfigFilter = cameraConfigFilter; arCoreExtensionsConfig.cloudAnchorMode = CloudAnchorMode.Enabled; AssetDatabase.SaveAssets(); ``` -------------------------------- ### Common Issues in Visualization Source: https://github.com/augg-io/documentation/blob/main/03_start_using_auggio.md Troubleshooting common visualization problems in the Unity editor, such as invisible or pink mesh scans, and how to resolve them. ```Unity * Sometimes mesh scans can be invisible. In this case select **VisualizationHierarch**y and make sure Visualize Mesh is set to true. * Sometimes mesh scans can be pink. If this happens make sure the material is set in **VisualizationHierarchy** ``` -------------------------------- ### Local Testing Script (Bash) Source: https://github.com/augg-io/documentation/blob/main/VERSION-DOCS-README.md Shell script to test the versioned documentation system locally. It builds all versions and starts a local HTTP server. ```bash #!/bin/bash PORT=8000 # Parse arguments for port if [[ "$1" == "--port" ]] && [[ -n "$2" ]]; then PORT=$2 fi echo "Starting local testing server on port $PORT..." # Build main branch # bundle exec jekyll build --destination _site/latest # Build version branches (example: v1.0.0, v1.1.0) # git branch --list 'v*' | while read -r branch_name; do # VERSION=$(echo $branch_name | sed 's/.*\///') # echo "Building version: $VERSION" # git checkout $branch_name # bundle exec jekyll build --destination _site/$VERSION # done # Create versions.json (example) # echo "[ # { \"version\": \"latest\", \"path\": \"latest\" }, # { \"version\": \"v1.0.0\", \"path\": \"v1.0.0\" }, # { \"version\": \"v1.1.0\", \"path\": \"v1.1.0\" } # ]" > _site/versions.json # Start local server # python -m http.server $PORT --directory _site echo "Local testing server started. Access at http://localhost:$PORT/latest/" # Note: Actual implementation requires more robust branch detection and build logic. # This is a conceptual representation. ``` -------------------------------- ### Debugging Console Logs for Version Selector Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Example of adding console logs to the version-selector.js file for debugging purposes. ```javascript console.log('Current path:', currentPath); console.log('Current version:', currentVersion); console.log('Target URL:', targetUrl); ``` -------------------------------- ### Jekyll Configuration (_config.yml) Source: https://github.com/augg-io/documentation/blob/main/VERSION-DOCS-README.md Example configuration for a Jekyll site used within the versioned documentation system. This file would typically be updated by the versioning scripts. ```yaml title: My Versioned Docs baseurl: "/documentation" # If deployed under a subpath url: "https://augg-io.github.io" # Your GitHub Pages URL # Versioning specific configuration (example) version: "latest" # This would be updated by create-version-branch.sh # Plugins and other Jekyll settings plugins: - jekyll-seo-tag - jekyll-paginate # Exclude files from build exclude: - Gemfile - Gemfile.lock - node_modules - vendor/ - README.md - create-version-branch.sh - test-versions-locally.sh - kill-http-servers.sh ``` -------------------------------- ### Subscribe to augg.io Collection Initialization Events in Unity Source: https://github.com/augg-io/documentation/blob/main/Using_Collections.md Shows how to subscribe to various events provided by the CollectionsProvider to handle successful initialization, errors, and progress updates during collection setup. This allows for reactive programming based on the collection's initialization state. ```csharp CollectionsProvider.Instance.OnProviderInitialized += HandleInitialized; CollectionsProvider.Instance.OnProviderInitializeError += HandleError; CollectionsProvider.Instance.OnProviderInitializedProgress += HandleProgress; ``` -------------------------------- ### ARCore Extensions Installation/Upgrade Source: https://github.com/augg-io/documentation/blob/main/Upgrading_to_Unity_6.md Guidance on installing ARCore Extensions for new projects or upgrading existing installations (e.g., from v1.39) to ensure compatibility with Unity 6. ```unity Install ARCore Extensions: https://developers.google.com/ar/develop/unity-arf/getting-started-extensions?ar_foundations_version=4#install_arcore ``` ```unity Upgrading ARCoreExtensions: /guides/upgrading_arcore_extensions/ ``` -------------------------------- ### Install ARCore Extensions (Unity) Source: https://github.com/augg-io/documentation/blob/main/Upgrading_ARCoreExtensions_in_the_project.md Instructions for installing ARCore Extensions in a Unity project, emphasizing the selection of ARFoundation 5.x and handling potential conflicts with the External Dependency Manager. ```csharp // Step 1: Delete current ARCoreExtensions using the package manager. // Example command (replace with your package manager's syntax): // npm uninstall @google/arcore-extensions // or // yarn remove @google/arcore-extensions // Step 2: Install the new version from the provided tutorial or by searching for 'ARCore Extensions without EDM4U release'. // Ensure ARFoundation 5.x is selected. // If downloading a .tar file, rename it to .tgz before adding via Unity's Package Manager. ``` -------------------------------- ### Build and Serve Jekyll Site for a Specific Version Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Commands to checkout a specific version branch and serve the Jekyll site locally for testing. ```bash # Checkout the version branch git checkout v1.0.0 # Build the site bundle exec jekyll serve ``` -------------------------------- ### Creating Redirect to Latest Version Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md This snippet shows how to create an index.html file in the root of the deployed site that automatically redirects users to the 'latest' documentation version. ```bash echo '' > _site/index.html ``` -------------------------------- ### Unity XR Plug-in Management Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Configures XR plug-in management in Unity, enabling ARCore and restarting the editor. ```Unity Editor Script XRGeneralSettings.Instance.Manager.InitializeLoaderSync(); ARCoreLoader.Instance.enabled = true; EditorApplication.ExecuteProjectGeneration(); EditorApplication.Exit(ExitPlaymodeOptions.Stop); // Restart editor ``` -------------------------------- ### Unity Player Settings (Android) Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Configures player settings for Android builds in Unity, including graphics API, multithreaded rendering, scripting backend, and minimum API level. ```C# PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTargetGroup.Android, false); PlayerSettings.SetGraphicsAPIs(BuildTarget.Android, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 }); PlayerSettings.SetUseMultithreadedRendering(BuildTargetGroup.Android, false); PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApi24; PlayerSettings.SetScriptingBackend(BuildTargetGroup.Android, ScriptingImplementation.IL2CPP); ``` -------------------------------- ### File Download Request Source: https://github.com/augg-io/documentation/blob/main/auggio_Tools/Pigeon_HTTP_Client_Manual.md Makes a GET request to download a file and handles the response data using a callback. ```csharp Pigeon.Get("/files/document.pdf") .IsFile(fileData => { // Handle downloaded file data }) .Send(); ``` -------------------------------- ### ARCore Extensions Configuration Source: https://github.com/augg-io/documentation/blob/main/01_setting_up_auggio_in_a_project.md Steps to configure ARCore Extensions in Unity Project Settings for iOS and Cloud Anchor functionality. ```unity 1. In the top menu click **Edit** 2. Select **Project Settings** 3. Choose **ARCore Extensions** 4. Set **iOS Enabled** to true (if needed) 5. Set **Cloud Anchor** to true 6. Set **Authentication Strategy** to **API key** ``` -------------------------------- ### Custom Authentication Layer Source: https://github.com/augg-io/documentation/blob/main/auggio_Tools/Pigeon_HTTP_Client_Manual.md Example implementation of an AbstractAuthLayer for custom authentication logic, including handling authorization headers and processing responses. ```csharp public class MyAuthLayer : AbstractAuthLayer { public override string GetAuthorizationHeaderValue() { return $"Bearer {GetCurrentToken()}"; } public override void Process(PigeonRequest authorizedRequest) { // Handle 401 responses, refresh tokens, etc. // Call authorizedRequest.Send() after handling } } ``` -------------------------------- ### JavaScript Asset Loading with Fallbacks Source: https://github.com/augg-io/documentation/blob/main/_includes/head_custom.html Demonstrates how to dynamically load JavaScript and CSS files using helper functions. These functions include error handling to attempt loading a fallback URL if the primary URL fails. ```javascript function loadCSS(url, fallbackUrl) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.href = url; link.onerror = function() { console.log('Failed to load CSS: ' + url + ', trying fallback'); this.href = fallbackUrl; }; document.head.appendChild(link); } function loadJS(url, fallbackUrl) { var script = document.createElement('script'); script.src = url; script.onerror = function() { console.log('Failed to load JS: ' + url + ', trying fallback'); this.src = fallbackUrl; }; document.head.appendChild(script); } if (typeof just_the_docs === 'undefined') { loadJS('{{ site.baseurl }}/assets/js/just-the-docs.js', '/assets/js/just-the-docs.js'); loadCSS('{{ site.baseurl }}/assets/css/just-the-docs-default.css', '/assets/css/just-the-docs-default.css'); } ``` -------------------------------- ### Logging Site and Page Variables Source: https://github.com/augg-io/documentation/blob/main/_includes/head_custom.html Logs the site's base URL, the current page URL, and the window's location to the console. ```javascript console.log('Site baseurl: {{ site.baseurl }}'); console.log('Current page: {{ page.url }}'); console.log('Window location: ' + window.location.href); ``` -------------------------------- ### Git Branching for Versions Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Illustrates the command-line steps for creating a new Git branch for a specific version, making changes, and pushing it to the remote repository. ```bash # Create a new version branch git checkout -b v1.0.0 # Make version-specific changes # Push the branch git push -u origin v1.0.0 ``` -------------------------------- ### Unity Player Settings (iOS) Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Configures player settings for iOS builds in Unity, including multithreaded rendering, bundle identifier, target minimum iOS version, ARKit support, and camera usage description. ```C# PlayerSettings.SetUseMultithreadedRendering(BuildTargetGroup.iOS, false); PlayerSettings.bundleIdentifier = "your.bundle.identifier"; PlayerSettings.iOS.targetMinimumiOSVersion = "14.0"; PlayerSettings.SetArchitecture(BuildTargetGroup.iOS, IOsArchitecture.ARM64); PlayerSettings.SetRequiresARKitSupport(BuildTargetGroup.iOS, true); PlayerSettings.cameraUsageDescription = "Your camera usage description"; ``` -------------------------------- ### Google API Key Generation Source: https://github.com/augg-io/documentation/blob/main/02_creating_google_service_account_and_getting_google_api_key.md Steps to generate a Google API Key, which is required in your Unity application to resolve previously created anchors and display content. ```APIDOC Get Google API Key: 1. Return to the 'Credentials' screen in Google Console. 2. Click 'Create Credentials' and select 'API Key'. 3. Copy the generated API key. 4. Paste the API key into the Unity Editor as per the 'Setting up ARCoreExtensions' chapter. ``` -------------------------------- ### Unity SDK Update Steps Source: https://github.com/augg-io/documentation/blob/main/Updating_SDK.md Instructions for updating the augg.io SDK in a Unity project. This includes removing the old SDK files, uninstalling the package from the Package Manager, and installing the new SDK package from a tarball. ```csharp 1. Remove the Old SDK: - Navigate to your project's Assets folder - Delete the existing augg.io SDK folder (e.g., `Assets/augg.io`) 2. Insert the New SDK: - Copy the new SDK files into your project - Place them in the same location (e.g., `Assets/augg.io`) 3. Remove the old Package from Package Manager: - In Unity, go to **Window → Package Manager** - Find and select the augg.io plugin - Click the **Remove** button 4. Install the New Package to Package Manager: - In the Package Manager window, click the **+** icon - Select **Install package from tarball** - Navigate to the new SDK package file - Select the package file and confirm ``` -------------------------------- ### GitHub Actions Workflow for Deploying Versioned Docs Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md This YAML workflow automates the process of checking out a repository, setting up Ruby, identifying all version branches, building documentation for each version (including the 'main' branch as 'latest'), generating a version selector JSON file, and deploying the combined documentation to GitHub Pages. ```yaml name: Deploy Documentation on: push: branches: - main - 'v*' workflow_dispatch: jobs: build-deploy: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history and tags - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' bundler-cache: true - name: Get all version branches id: get-versions run: | echo "VERSIONS<> $GITHUB_ENV git branch -r | grep 'origin/v' | sed 's/origin\///' >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV echo "::set-output name=current_branch::$(git branch --show-current)" - name: Build main branch (latest) run: | mkdir -p _site/latest bundle exec jekyll build -d _site/latest # Note: We're not copying to root as per requirement - name: Build version branches run: | for branch in $VERSIONS; do echo "Building documentation for $branch" git checkout $branch mkdir -p _site/$branch bundle exec jekyll build -d _site/$branch # Create a .nojekyll file to prevent GitHub Pages from processing the site touch _site/$branch/.nojekyll done # Create a .nojekyll file in the root to prevent GitHub Pages from processing the site touch _site/.nojekyll # Create a redirect from root to /latest echo '' > _site/index.html git checkout ${{ steps.get-versions.outputs.current_branch }} - name: Generate version selector data run: | echo "Creating version selector data" echo '{"versions":["latest"' > _site/versions.json for branch in $VERSIONS; do echo ',"'$branch'"' >> _site/versions.json done echo ']}' >> _site/versions.json - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4 with: folder: _site branch: gh-pages ``` -------------------------------- ### Access Collection Data in Unity Source: https://github.com/augg-io/documentation/blob/main/Using_Collections.md Provides examples of how to retrieve a collection by its name and access its rows and field values within a Unity project. It also notes that field values are stored as strings and require conversion. ```csharp Collection myCollection; if (CollectionsProvider.Instance.GetCollectionByName("collectionName", out myCollection)) { // Use myCollection } // Access collection rows: // Get all rows: myCollection.Rows // Get a specific row by ID: myCollection.GetRowById("rowId") CollectionRow row = myCollection.GetRowById("rowId"); List fieldValues = row.GetValueByFieldName("fieldName"); ``` -------------------------------- ### Google Cloud ARCore API Enablement Source: https://github.com/augg-io/documentation/blob/main/02_creating_google_service_account_and_getting_google_api_key.md Steps to enable the ARCore API within your Google Cloud Console project. This is necessary for hosting and resolving Google Cloud anchors via augg.io. ```APIDOC Enable ARCore API in Google Cloud Console: 1. Navigate to console.cloud.google.com and log in. 2. Select or create a Google Cloud project. 3. Go to 'Enabled APIs & Services'. 4. Click '+ Enable APIs and Services'. 5. Search for 'ARCore API', open it, and click 'Enable'. ``` -------------------------------- ### Configure ARCore Extensions in Unity Source: https://github.com/augg-io/documentation/blob/main/00_create_an_empty_project.md Instructions for integrating and configuring ARCore Extensions within the Unity project, including creating configuration assets and enabling Cloud Anchors Mode. ```Unity ARCore Extensions Configuration 1. Right click in the hierarchy window. Select XR -> ARCore Extensions 2. Fill in the first three fields. Just click and select the only option available 3. Go to the Settings folder. 4. Create ARCoreExtensionsConfig and CameraConfigFilter 5. Select the ARCoreExtensionConfig you just created. And set Cloud Anchors Mode to enabled. 6. Select ARCoreExtension in the scene and set the two remaining fields. ``` -------------------------------- ### Google Cloud Service Account Creation Source: https://github.com/augg-io/documentation/blob/main/02_creating_google_service_account_and_getting_google_api_key.md Instructions for creating a Google Service Account, which grants augg.io access to manage Google Cloud anchors. This involves creating the account, generating a JSON key, and uploading it to augg.io. ```APIDOC Create Google Service Account: 1. Log in to console.cloud.google.com. 2. Select or create a Google Cloud project. 3. Navigate to 'Credentials' from the right-hand menu. 4. Click 'Create Credentials' and select 'Service Account'. 5. Provide a name for the service account (other fields are optional). 6. Click on the newly created service account. 7. Go to the 'Keys' tab, click 'Add Key', then 'Create new key'. 8. Select 'JSON' as the key type. 9. A JSON key file will be downloaded. Upload this file to cms.augg.io under 'Manage Organization' in your profile. 10. Confirm the data deletion prompt if necessary (data from the Trial tier will be lost). ``` -------------------------------- ### Initialize Collections in Unity Source: https://github.com/augg-io/documentation/blob/main/Using_Collections.md Demonstrates how to manually initialize the CollectionsProvider in a Unity project. This is an alternative to automatic initialization via the 'Initialize On Awake' setting. ```csharp CollectionsProvider.Instance.Initialize(); ``` -------------------------------- ### Placeholder Creation Wizard Source: https://github.com/augg-io/documentation/blob/main/04_using_auggio_unity_editor_plugin.md Details the parameters required when creating a new placeholder object using the Augg.io wizard. ```APIDOC Placeholder Creation Wizard: Parameters: Placeholder name: Name of the placeholder object (required, cannot be empty). Model representation: Primitive object to represent the placeholder. Experience: The experience under which to create the placeholder. Auggio object: The object under which to create the placeholder. ``` -------------------------------- ### Access augg.io Collection and Row Data in Unity Source: https://github.com/augg-io/documentation/blob/main/Using_Collections.md Illustrates how to retrieve a specific augg.io collection by its name and then access its rows and individual field values. It covers getting all rows, a specific row by ID, and extracting field values by name, noting that string conversion is often required. ```csharp Collection myCollection; if (CollectionsProvider.Instance.GetCollectionByName("collectionName", out myCollection)) { // Use myCollection } // Get all rows: // myCollection.Rows // Get a specific row by ID: // myCollection.GetRowById("rowId") CollectionRow row = myCollection.GetRowById("rowId"); List fieldValues = row.GetValueByFieldName("fieldName"); ``` -------------------------------- ### Handle Collection Initialization Events in Unity Source: https://github.com/augg-io/documentation/blob/main/Using_Collections.md Shows how to subscribe to events for tracking the progress and status of collection initialization in Unity. This allows for custom handling of success, errors, and progress updates. ```csharp CollectionsProvider.Instance.OnProviderInitialized += HandleInitialized; CollectionsProvider.Instance.OnProviderInitializeError += HandleError; CollectionsProvider.Instance.OnProviderInitializedProgress += HandleProgress; ``` -------------------------------- ### Pigeon HTTP Client Initialization Options Source: https://github.com/augg-io/documentation/blob/main/auggio_Tools/Pigeon_HTTP_Client_Manual.md Configuration options for initializing the Pigeon HTTP client, including setting the base URL, default headers, authentication, timeouts, and logging. ```APIDOC Pigeon.Initialize() .SetHostname(string hostname) - Base URL for all requests - Default: None .SetDefaultAuthLayer(AbstractAuthLayer authLayer) - Default authorization handler - Default: None .SetDefaultHeaders(Dictionary headers) - Headers added to all requests - Default: Empty .SetDefaultTimeout(int seconds) - Request timeout in seconds - Default: 10 .SetDefaultAuthorizationHeaderName(string headerName) - Custom auth header name - Default: "Authorization" .Log(RequestLogger.LOG_LEVEL level) - Set logging verbosity - Default: None ``` -------------------------------- ### Unity Project Upgrade Steps Source: https://github.com/augg-io/documentation/blob/main/Upgrading_to_Unity_6.md General steps for upgrading a Unity project to Unity 6, including opening the project, handling version change prompts, and resolving initial errors. ```unity 1. Open Unity Hub, select your project and change to Unity 6 version. 2. Acknowledge any warning pop-up indicating potential compatibility issues. 3. If Unity flags errors on the first project load, ignore them and try closing and reopening the project. 4. Allow Unity to import TextMeshPro Essentials if prompted. ``` -------------------------------- ### AuggioExperience Script Source: https://github.com/augg-io/documentation/blob/main/04_using_auggio_unity_editor_plugin.md The AuggioExperience script is attached to the top-level 'Experience' game object. It serves as the main entry point for the imported experience and manages the overall structure. ```APIDOC AuggioExperience: Attached to: Top-level 'Experience' game object. Purpose: Manages the overall imported experience and its hierarchy. ``` -------------------------------- ### CSS for Version Selector Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Provides basic styling for the version selector component, ensuring it is displayed correctly within the documentation layout. ```css /* assets/css/version-selector.css */ .version-selector { display: inline-block; margin: 1rem; font-size: 0.9rem; } .version-selector select { margin-left: 0.5rem; padding: 0.25rem; border-radius: 4px; border: 1px solid #ccc; } ``` -------------------------------- ### JavaScript Version Selector Source: https://github.com/augg-io/documentation/blob/main/versioned-documentation-plan.md Implements a dynamic version selector for documentation. It fetches available versions from a JSON file, detects the current version from the URL or local storage, and allows users to switch between versions, navigating to the corresponding documentation page. It also includes a check to ensure the target page exists before redirecting. ```javascript // assets/js/version-selector.js document.addEventListener('DOMContentLoaded', function() { // Fetch available versions fetch('/documentation/versions.json') .then(response => response.json()) .then(data => { const versions = data.versions; createVersionSelector(versions); }) .catch(error => console.error('Error loading versions:', error)); function createVersionSelector(versions) { // Get current version from URL or localStorage let currentPath = window.location.pathname; let currentVersion = 'latest'; // Extract version from path if present const pathMatch = currentPath.match(//documentation/([^/]+)/); if (pathMatch && versions.includes(pathMatch[1])) { currentVersion = pathMatch[1]; } else if (localStorage.getItem('docs-version')) { currentVersion = localStorage.getItem('docs-version'); } else { // Default to latest if no version is detected currentVersion = 'latest'; } // Create the selector element const selector = document.createElement('div'); selector.className = 'version-selector'; const label = document.createElement('span'); label.textContent = 'Version: '; selector.appendChild(label); const select = document.createElement('select'); select.id = 'version-select'; versions.forEach(version => { const option = document.createElement('option'); option.value = version; option.textContent = version === 'latest' ? 'Latest' : version; option.selected = version === currentVersion; select.appendChild(option); }); select.addEventListener('change', function() { const newVersion = this.value; localStorage.setItem('docs-version', newVersion); // Get the current page path relative to the version let pagePath = ''; if (currentPath.includes('/documentation/')) { // Extract the page path after the version const versionRegex = new RegExp(`/documentation/${currentVersion}(/.*)?`); const pageMatch = currentPath.match(versionRegex); if (pageMatch && pageMatch[1]) { pagePath = pageMatch[1]; } } else if (currentPath === '/' || currentPath === '') { // If at the root, use empty path pagePath = '/'; } // Construct the new URL const newVersionBase = `/documentation/${newVersion}`; const targetUrl = pagePath ? `${newVersionBase}${pagePath}` : newVersionBase; // Check if the page exists in the new version checkPageExists(targetUrl) .then(exists => { if (exists) { // Page exists, navigate to it window.location.href = targetUrl; } else { // Page doesn't exist, navigate to the version homepage window.location.href = newVersionBase + '/'; } }) .catch(() => { // On error, default to the version homepage window.location.href = newVersionBase + '/'; }); }); selector.appendChild(select); // Add the selector to the page const header = document.querySelector('header'); if (header) { header.appendChild(selector); } else { document.body.insertBefore(selector, document.body.firstChild); } } // Function to check if a page exists function checkPageExists(url) { return fetch(url, { method: 'HEAD' }) .then(response => response.ok) .catch(() => false); } }); ``` -------------------------------- ### augg.io Unity Editor Plugin - Experiences List Source: https://github.com/augg-io/documentation/blob/main/04_using_auggio_unity_editor_plugin.md Explains how the experiences list functions within the augg.io Unity Editor plugin. It details how experiences are displayed, the criteria for an experience to appear (reviewed anchors), and how to identify experiences already present in the current Unity scene. ```csharp // Experience List: // Displays experiences with at least one reviewed anchor. // An indicator (Unity logo and "(in scene)") appears for experiences already imported into the current scene. // Clicking an experience item displays its details. ``` -------------------------------- ### Initialize Pigeon HTTP Client Source: https://github.com/augg-io/documentation/blob/main/auggio_Tools/Pigeon_HTTP_Client_Manual.md Initializes the Pigeon HTTP client with base URL, default headers, authentication layer, and error handling. Sets the logging level for requests. ```csharp Pigeon.Initialize() .SetHostname("https://api.example.com") .SetDefaultHeaders(new Dictionary { {"Accept", "application/json"}, {"Content-Type", "application/json"} }) .SetDefaultAuthLayer(new AuthLayer()) .SetOnAuthorizationError(HandleAuthError) .Log(RequestLogger.LOG_LEVEL.ALL); ``` -------------------------------- ### augg.io Unity Editor Plugin - Basic Usage Source: https://github.com/augg-io/documentation/blob/main/04_using_auggio_unity_editor_plugin.md Details the main interface of the augg.io Unity Editor plugin after successful login. It explains how to select an organization, access plugin settings, log out, and view the list of available experiences. ```csharp // Plugin Home Screen: // [1] Select Organization dropdown // [2] Settings button // [3] Logout button // [4] Experiences list ``` -------------------------------- ### GitHub Actions Deployment Workflow (YAML) Source: https://github.com/augg-io/documentation/blob/main/VERSION-DOCS-README.md GitHub Actions workflow file for building and deploying versioned documentation. It handles pushes to main and version branches, detects all versions, and deploys to GitHub Pages. ```yaml name: Deploy Docs on: push: branches: - main - 'v*' jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for branch detection - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' - name: Install dependencies run: bundle install - name: Build and Deploy Docs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # This script would orchestrate building each version and deploying # Example: ./build-all-versions.sh echo "Running build and deploy process..." # Placeholder for actual build and deploy commands # This might involve running Jekyll build for each version and copying to a deploy directory # Then using a deployment action like 'actions/deploy-pages' echo "Build and deploy complete." ```