// Copyright (c) 2025 TerraByte Inc. // // A new utility class that uses [InitializeOnLoad] to safely cache data // from Unity's main thread that is needed by background threads. using System.IO; using UnityEngine; using UnityEditor; using UnityEngine.Scripting; namespace Terra.Arbitrator.Services { [Preserve] [InitializeOnLoad] public static class MainThreadDataCache { /// /// A thread-safe, cached path to the project's root directory. /// public static string ProjectRoot { get; private set; } static MainThreadDataCache() { ProjectRoot = Directory.GetParent(Application.dataPath)?.FullName; } } }