add tile key selection for addressables builds
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
@@ -46,6 +48,44 @@ public static class MissingScriptUtility
|
||||
Debug.Log($"[MissingScriptUtility] Missing scripts found in prefabs: {missingCount}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Diagnostics/Find Missing Scripts in ScriptableObjects")]
|
||||
public static void FindMissingScriptsInScriptableObjects()
|
||||
{
|
||||
var assetGuids = AssetDatabase.FindAssets("t:ScriptableObject");
|
||||
int missingCount = 0;
|
||||
|
||||
for (int i = 0; i < assetGuids.Length; i++)
|
||||
{
|
||||
var path = AssetDatabase.GUIDToAssetPath(assetGuids[i]);
|
||||
EditorUtility.DisplayProgressBar("Scanning ScriptableObjects", path, (float)i / assetGuids.Length);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(path) || !path.EndsWith(".asset", StringComparison.OrdinalIgnoreCase))
|
||||
continue;
|
||||
|
||||
if (!File.Exists(path))
|
||||
continue;
|
||||
|
||||
string contents;
|
||||
try
|
||||
{
|
||||
contents = File.ReadAllText(path);
|
||||
}
|
||||
catch
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (contents.Contains("m_Script: {fileID: 0}"))
|
||||
{
|
||||
missingCount++;
|
||||
Debug.LogWarning($"[MissingScriptUtility] Missing script reference in asset: {path}");
|
||||
}
|
||||
}
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
Debug.Log($"[MissingScriptUtility] Missing scripts found in scriptable objects: {missingCount}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Diagnostics/Remove Missing Scripts in Open Scenes")]
|
||||
public static void RemoveMissingScriptsInOpenScenes()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user