Example #1
0
 static AssetBundleInfo getAssetBundle(string name, string pathFromDataPath = MODS_FOLDER_NAME)
 {
     return(AssetBundleInfo.CreateOrGetCached(pathFromDataPath + name));
 }
Example #2
0
        // New mod loading system

        /*
         * /// <summary>
         * /// Gets a <see cref="GameObject"/> from an asset bundle
         * /// </summary>
         * /// <param name="assetBundleName">The name of the asset bundle file (Must be located in the 'mods' folder for this method)</param>
         * /// <param name="objectName">The name of the object you want to get from the asset bundle</param>
         * /// <returns></returns>
         * public static GameObject GetObjectFromFile(string assetBundleName, string objectName)
         * {
         *  string path = InternalUtils.GetCallerModPath();
         *  return getObjectFromFileInternal<GameObject>(assetBundleName, objectName, path);
         * }
         *
         * /// <summary>
         * /// Gets a <see cref="GameObject"/> from an asset bundle
         * /// </summary>
         * /// <param name="assetBundleName">The name of the asset bundle file</param>
         * /// <param name="objectName">The name of the object you want to get from the asset bundle</param>
         * /// <param name="customPath">The custom path of the asset bundle, starts from your mods root folder</param>
         * /// <returns></returns>
         * public static GameObject GetObjectFromFile(string assetBundleName, string objectName, string customPath)
         * {
         *  string path = InternalUtils.GetCallerModPath();
         *  return getObjectFromFileInternal<GameObject>(assetBundleName, objectName, path + customPath);
         * }
         *
         * /// <summary>
         * /// Gets an Object of type <typeparamref name="T"/> from an asset bundle
         * /// </summary>
         * /// <typeparam name="T">The type of the object</typeparam>
         * /// <param name="assetBundleName">The name of the asset bundle file</param>
         * /// <param name="objectName">The name of the object you want to get from the asset bundle</param>
         * /// <returns></returns>
         * public static T GetObjectFromFile<T>(string assetBundleName, string objectName) where T : UnityEngine.Object
         * {
         *  string path = InternalUtils.GetCallerModPath();
         *  return getObjectFromFileInternal<T>(assetBundleName, objectName, path);
         * }
         *
         * /// <summary>
         * /// Gets an Object of type <typeparamref name="T"/> from an assetbundle
         * /// </summary>
         * /// <typeparam name="T">The type of the object in the assetbundle</typeparam>
         * /// <param name="assetBundleName">The name of the assetbundle file</param>
         * /// <param name="objectName">The name of the object you want to get from the assetbundle</param>
         * /// <param name="customPath">The custom path where the assetbundle is located, from your mods root folder</param>
         * /// <returns></returns>
         * public static T GetObjectFromFile<T>(string assetBundleName, string objectName, string customPath) where T : UnityEngine.Object
         * {
         *  string path = InternalUtils.GetCallerModPath();
         *  return getObjectFromFileInternal<T>(assetBundleName, objectName, path + customPath);
         * }
         */

        /// <summary>
        /// Clears the cache for loaded assets
        /// </summary>
        public static void ClearCache()
        {
            AssetBundleInfo.ClearCache();
        }