UI HUGE UPDATE
This commit is contained in:
@@ -59,17 +59,17 @@ public static class RuntimeResourcesCache
|
||||
|
||||
public static SongData[] LoadAllSongs()
|
||||
{
|
||||
return LoadAll<SongData>(string.Empty);
|
||||
return MergeArrays(LoadAll<SongData>(string.Empty), DlcRuntimeRegistry.GetAllSongs());
|
||||
}
|
||||
|
||||
public static SongData[] LoadSongIndex()
|
||||
{
|
||||
return LoadAll<SongData>("song_songIndex");
|
||||
return MergeArrays(LoadAll<SongData>("song_songIndex"), DlcRuntimeRegistry.GetAllSongs());
|
||||
}
|
||||
|
||||
public static SongData[] LoadSongsFromPath(string path)
|
||||
{
|
||||
return LoadAll<SongData>(path);
|
||||
return MergeArrays(LoadAll<SongData>(path), DlcRuntimeRegistry.GetAllSongs());
|
||||
}
|
||||
|
||||
public static AllyHero_SO[] LoadAllAllyHeroes()
|
||||
@@ -84,7 +84,17 @@ public static class RuntimeResourcesCache
|
||||
|
||||
public static dlcData[] LoadAllDlcs()
|
||||
{
|
||||
return LoadAll<dlcData>(string.Empty);
|
||||
return MergeArrays(LoadAll<dlcData>(string.Empty), DlcRuntimeRegistry.GetAllDlcs());
|
||||
}
|
||||
|
||||
public static HeroSkinSO[] LoadAllHeroSkins()
|
||||
{
|
||||
return MergeArrays(LoadAll<HeroSkinSO>("so/heroSkins"), DlcRuntimeRegistry.GetAllHeroSkins());
|
||||
}
|
||||
|
||||
public static SongDlcContentSO[] LoadAllSongDlcContents()
|
||||
{
|
||||
return MergeArrays(LoadAll<SongDlcContentSO>("so/songDlcContents"), DlcRuntimeRegistry.GetAllSongContents());
|
||||
}
|
||||
|
||||
public static expBottlesSO[] LoadAllExpBottles()
|
||||
@@ -117,4 +127,38 @@ public static class RuntimeResourcesCache
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(path) ? string.Empty : path.Trim().Replace("\\", "/");
|
||||
}
|
||||
|
||||
private static T[] MergeArrays<T>(T[] builtIn, T[] runtime) where T : UnityEngine.Object
|
||||
{
|
||||
if (runtime == null || runtime.Length == 0)
|
||||
{
|
||||
return builtIn ?? Array.Empty<T>();
|
||||
}
|
||||
|
||||
if (builtIn == null || builtIn.Length == 0)
|
||||
{
|
||||
return runtime;
|
||||
}
|
||||
|
||||
List<T> result = new List<T>(builtIn.Length + runtime.Length);
|
||||
for (int i = 0; i < builtIn.Length; i++)
|
||||
{
|
||||
T item = builtIn[i];
|
||||
if (item != null && !result.Contains(item))
|
||||
{
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < runtime.Length; i++)
|
||||
{
|
||||
T item = runtime[i];
|
||||
if (item != null && !result.Contains(item))
|
||||
{
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user