Kursach_StealthAction/Assets/Tremble/Editor/Utils/AssetDatabaseUtil.cs
2026-10-11 19:16:11 +03:00

37 lines
788 B
C#

//
// This file is part of the Tremble package by Tiny Goose.
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
//
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
namespace TinyGoose.Tremble.Editor
{
internal static class AssetDatabaseUtil
{
internal static List<string> GetAllTrembleMapPaths()
{
List<string> allMaps = new();
string[] assetPaths = AssetDatabase.GetAllAssetPaths();
foreach (string assetPath in assetPaths)
{
if (!IsTrembleMapFile(assetPath))
continue;
if (assetPath.Contains("autosave/"))
continue;
allMaps.Add(assetPath);
}
return allMaps;
}
internal static bool IsTrembleMapFile(string assetPath)
=> Path.GetExtension(assetPath).EqualsInvariant(".map");
}
}