private static void LoadAssetBundle(string relativePath) { ModAssetBundleManager.RegisterAssetBundle(relativePath); AssetBundle assetBundle = ModAssetBundleManager.GetAssetBundle(relativePath); string[] assetNames = assetBundle.GetAllAssetNames(); foreach (string eachAssetName in assetNames) { if (eachAssetName.EndsWith(".prefab")) { AutoMapPrefab(eachAssetName, relativePath); } } }
public static UnityEngine.Object GetAsset(string name) { if (AlternateIconManager.ContainsKey(name)) { return(AlternateIconManager.GetTexture(name)); } else if (ModAssetBundleManager.IsKnownAsset(name)) { return(ModAssetBundleManager.LoadAsset(name)); } else if (AlternateAssetManager.AssetExists(name)) { return(AlternateAssetManager.GetAsset(name)); } else { return(null); } }
internal static UIAtlas GetRequiredAtlas(UISprite sprite, string value) { if (string.IsNullOrEmpty(value)) { return(sprite.atlas); } UIAtlas atlas = ModAssetBundleManager.GetSpriteAtlas(value); if (atlas != null) { return(atlas); } SaveAtlas restoreAtlas = sprite.gameObject.GetComponent <SaveAtlas>(); if (restoreAtlas != null) { return(restoreAtlas.original); } return(sprite.atlas); }
internal static void LoadAssetBundle(string relativePath) { LoadAssetBundle(ModAssetBundleManager.GetAssetBundle(relativePath)); }
public static bool IsKnownAsset(string name) => ModAssetBundleManager.IsKnownAsset(name) || AlternateIconManager.ContainsKey(name) || AlternateAssetManager.AssetExists(name);