Initial check-in

This commit is contained in:
Christopher Clendening
2026-11-22 13:18:46 -05:00
commit 93b8626de4
65 changed files with 7847 additions and 0 deletions
+76
View File
@@ -0,0 +1,76 @@
using System.IO;
using UnityEditor;
using UnityEditor.PackageManager;
[InitializeOnLoad]
public static class HubForceResolve
{
private const string k_ScriptPath = "Assets/Editor/HubForceResolve.cs";
private const string k_EditorFolderPath = "Assets/Editor";
private const string k_StateKey = "Hub.ForceResolve.State";
static HubForceResolve()
{
EditorApplication.delayCall += Tick;
}
static void Tick()
{
// Wait until the Editor is idle so the resolve/self-delete don't fight the import.
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
{
EditorApplication.delayCall += Tick;
return;
}
if (SessionState.GetString(k_StateKey, "") == "")
{
// First idle pass: resolve. May reload, after which Tick runs again.
SessionState.SetString(k_StateKey, "resolved");
Client.Resolve();
EditorApplication.delayCall += Tick;
return;
}
// Resolved and idle again → remove the script.
Cleanup();
}
static void Cleanup()
{
AssetDatabase.DeleteAsset(k_ScriptPath);
CleanupEmptyEditorFolder();
}
static void CleanupEmptyEditorFolder()
{
string absolutePath = Path.GetFullPath(k_EditorFolderPath);
if (!Directory.Exists(absolutePath)) return;
string[] files = Directory.GetFiles(absolutePath);
string[] dirs = Directory.GetDirectories(absolutePath);
bool isEmpty = true;
if (dirs.Length > 0)
{
isEmpty = false;
}
foreach (string file in files)
{
if (!file.EndsWith(".DS_Store"))
{
isEmpty = false;
break;
}
}
if (isEmpty)
{
AssetDatabase.DeleteAsset(k_EditorFolderPath);
}
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dea4179f0999200409d1321f69c1556b