FIx bug animation not stop. add more QOL for test animation scene. add AnimationSceneSkillTest.md to show how to use
This commit is contained in:
@@ -493,25 +493,27 @@ namespace BrewMonster.Scripts
|
||||
/// <returns>True if the key exists, false otherwise.</returns>
|
||||
public static bool KeyExists(object key, System.Type type = null)
|
||||
{
|
||||
string keyStr = key?.ToString();
|
||||
if (string.IsNullOrEmpty(keyStr))
|
||||
return false;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
return !Instance._invalidAssetPaths.Contains(key.ToString());
|
||||
#else
|
||||
// Iterate through all loaded locators (catalogs)
|
||||
// Failed loads are cached; still verify against catalog (do not assume unknown keys exist).
|
||||
if (Instance != null && Instance._invalidAssetPaths.Contains(keyStr))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
foreach (IResourceLocator locator in Addressables.ResourceLocators)
|
||||
{
|
||||
// If the locator finds the key, it returns true
|
||||
if (locator.Locate(key, type, out var locations))
|
||||
if (locator.Locate(key, type, out var locations)
|
||||
&& locations != null
|
||||
&& locations.Count > 0)
|
||||
{
|
||||
// Double check that it actually yielded at least one location
|
||||
if (locations != null && locations.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user