using UnityEditor; using UnityEditor.PackageManager; using UnityEngine; namespace Amanotes { internal static class PackageResolveScheduler { private const double DebounceSeconds = 3.0; private static double resolveTime; private static bool scheduled; internal static void Schedule() { resolveTime = EditorApplication.timeSinceStartup + DebounceSeconds; if (scheduled) return; scheduled = true; EditorApplication.update += CheckResolve; } private static void CheckResolve() { if (EditorApplication.timeSinceStartup < resolveTime) return; scheduled = false; EditorApplication.update -= CheckResolve; Debug.Log("[AmaDev] Resolving packages..."); Client.Resolve(); } } }