Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
 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);
        }
Esempio n. 4
0
 internal static void LoadAssetBundle(string relativePath)
 {
     LoadAssetBundle(ModAssetBundleManager.GetAssetBundle(relativePath));
 }
Esempio n. 5
0
 public static bool IsKnownAsset(string name) => ModAssetBundleManager.IsKnownAsset(name) || AlternateIconManager.ContainsKey(name) || AlternateAssetManager.AssetExists(name);