Files
2026-06-04 11:42:34 +02:00

478 lines
16 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using UnityEngine.Scripting;
namespace UnityEngine
{
// Token: 0x02000025 RID: 37
public sealed class Caching
{
// Token: 0x06000252 RID: 594
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool ClearCache();
// Token: 0x06000253 RID: 595
[Obsolete("This function is obsolete and will always return -1. Use IsVersionCached instead.")]
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int GetVersionFromCache(string url);
// Token: 0x06000254 RID: 596 RVA: 0x00005610 File Offset: 0x00003810
public static bool ClearCachedVersion(string assetBundleName, Hash128 hash)
{
return Caching.INTERNAL_CALL_ClearCachedVersion(assetBundleName, ref hash);
}
// Token: 0x06000255 RID: 597
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool INTERNAL_CALL_ClearCachedVersion(string assetBundleName, ref Hash128 hash);
// Token: 0x06000256 RID: 598 RVA: 0x00005630 File Offset: 0x00003830
public static bool ClearOtherCachedVersions(string assetBundleName, Hash128 hash)
{
return Caching.INTERNAL_CALL_ClearOtherCachedVersions(assetBundleName, ref hash);
}
// Token: 0x06000257 RID: 599
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool INTERNAL_CALL_ClearOtherCachedVersions(string assetBundleName, ref Hash128 hash);
// Token: 0x06000258 RID: 600
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool ClearAllCachedVersions(string assetBundleName);
// Token: 0x06000259 RID: 601 RVA: 0x00005650 File Offset: 0x00003850
public static void GetCachedVersions(string assetBundleName, List<Hash128> outCachedVersions)
{
if (string.IsNullOrEmpty(assetBundleName))
{
throw new ArgumentException("Input AssetBundle name cannot be null or empty.");
}
if (outCachedVersions == null)
{
throw new ArgumentNullException("Input outCachedVersions cannot be null.");
}
Caching.GetCachedVersionsInternal(assetBundleName, outCachedVersions);
}
// Token: 0x0600025A RID: 602
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern Hash128[] GetCachedVersions(string assetBundleName);
// Token: 0x0600025B RID: 603
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void GetCachedVersionsInternal(string assetBundleName, object cachedVersions);
// Token: 0x0600025C RID: 604 RVA: 0x00005684 File Offset: 0x00003884
[Obsolete("This function is obsolete. Please use IsVersionCached with Hash128 instead.")]
public static bool IsVersionCached(string url, int version)
{
Hash128 hash = new Hash128(0U, 0U, 0U, (uint)version);
return Caching.IsVersionCached(url, "", hash);
}
// Token: 0x0600025D RID: 605 RVA: 0x000056B0 File Offset: 0x000038B0
public static bool IsVersionCached(string url, Hash128 hash)
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentException("Input AssetBundle url cannot be null or empty.");
}
return Caching.IsVersionCached(url, "", hash);
}
// Token: 0x0600025E RID: 606 RVA: 0x000056E8 File Offset: 0x000038E8
public static bool IsVersionCached(CachedAssetBundle cachedBundle)
{
if (string.IsNullOrEmpty(cachedBundle.name))
{
throw new ArgumentException("Input AssetBundle name cannot be null or empty.");
}
return Caching.IsVersionCached("", cachedBundle.name, cachedBundle.hash);
}
// Token: 0x0600025F RID: 607 RVA: 0x00005734 File Offset: 0x00003934
internal static bool IsVersionCached(string url, string name, Hash128 hash)
{
return Caching.INTERNAL_CALL_IsVersionCached(url, name, ref hash);
}
// Token: 0x06000260 RID: 608
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool INTERNAL_CALL_IsVersionCached(string url, string name, ref Hash128 hash);
// Token: 0x06000261 RID: 609 RVA: 0x00005754 File Offset: 0x00003954
[Obsolete("This function is obsolete. Please use MarkAsUsed with Hash128 instead.")]
public static bool MarkAsUsed(string url, int version)
{
Hash128 hash = new Hash128(0U, 0U, 0U, (uint)version);
return Caching.MarkAsUsed(url, "", hash);
}
// Token: 0x06000262 RID: 610 RVA: 0x00005780 File Offset: 0x00003980
public static bool MarkAsUsed(string url, Hash128 hash)
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentException("Input AssetBundle url cannot be null or empty.");
}
return Caching.MarkAsUsed(url, "", hash);
}
// Token: 0x06000263 RID: 611 RVA: 0x000057B8 File Offset: 0x000039B8
public static bool MarkAsUsed(CachedAssetBundle cachedBundle)
{
if (string.IsNullOrEmpty(cachedBundle.name))
{
throw new ArgumentException("Input AssetBundle name cannot be null or empty.");
}
return Caching.MarkAsUsed("", cachedBundle.name, cachedBundle.hash);
}
// Token: 0x06000264 RID: 612 RVA: 0x00005804 File Offset: 0x00003A04
internal static bool MarkAsUsed(string url, string name, Hash128 hash)
{
return Caching.INTERNAL_CALL_MarkAsUsed(url, name, ref hash);
}
// Token: 0x06000265 RID: 613
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool INTERNAL_CALL_MarkAsUsed(string url, string name, ref Hash128 hash);
// Token: 0x17000082 RID: 130
// (get) Token: 0x06000266 RID: 614
[Obsolete("this API is not for public use.")]
public static extern CacheIndex[] index
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x17000083 RID: 131
// (get) Token: 0x06000267 RID: 615
[Obsolete("This property is only used for the current cache, use GetSpaceFree() with cache index to get unused bytes per cache.")]
public static extern long spaceFree
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x17000084 RID: 132
// (get) Token: 0x06000268 RID: 616
// (set) Token: 0x06000269 RID: 617
[Obsolete("This property is only used for the current cache, use Cache.maximumAvailableStorageSpace to get/set the maximum available storage space per cache.")]
public static extern long maximumAvailableDiskSpace
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
// Token: 0x17000085 RID: 133
// (get) Token: 0x0600026A RID: 618
[Obsolete("This property is only used for the current cache, use Cache.spaceOccupied to get used bytes per cache.")]
public static extern long spaceOccupied
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x17000086 RID: 134
// (get) Token: 0x0600026B RID: 619
[Obsolete("Please use Cache.spaceAvailable to get unused bytes per cache.")]
public static extern int spaceAvailable
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x17000087 RID: 135
// (get) Token: 0x0600026C RID: 620
[Obsolete("Please use use Cache.spaceOccupied to get used bytes per cache")]
public static extern int spaceUsed
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x17000088 RID: 136
// (get) Token: 0x0600026D RID: 621
// (set) Token: 0x0600026E RID: 622
[Obsolete("This property is only used for the current cache, use Cache.expirationDelay to get/set the expiration delay per cache.")]
public static extern int expirationDelay
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
// Token: 0x17000089 RID: 137
// (get) Token: 0x0600026F RID: 623
// (set) Token: 0x06000270 RID: 624
public static extern bool compressionEnabled
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
// Token: 0x1700008A RID: 138
// (get) Token: 0x06000271 RID: 625
public static extern bool ready
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x06000272 RID: 626 RVA: 0x00005824 File Offset: 0x00003A24
public static Cache AddCache(string cachePath)
{
if (string.IsNullOrEmpty(cachePath))
{
throw new ArgumentNullException("Cache path cannot be null or empty.");
}
bool flag = false;
if (cachePath.Replace('\\', '/').StartsWith(Application.streamingAssetsPath))
{
flag = true;
}
else
{
if (!Directory.Exists(cachePath))
{
throw new ArgumentException("Cache path '" + cachePath + "' doesn't exist.");
}
if ((File.GetAttributes(cachePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
{
flag = true;
}
}
if (Caching.GetCacheByPath(cachePath).valid)
{
throw new InvalidOperationException("Cache with path '" + cachePath + "' has already been added.");
}
return Caching.AddCache_Internal(cachePath, flag);
}
// Token: 0x06000273 RID: 627 RVA: 0x000058D8 File Offset: 0x00003AD8
private static Cache AddCache_Internal(string cachePath, bool isReadonly)
{
Cache cache;
Caching.INTERNAL_CALL_AddCache_Internal(cachePath, isReadonly, out cache);
return cache;
}
// Token: 0x06000274 RID: 628
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_AddCache_Internal(string cachePath, bool isReadonly, out Cache value);
// Token: 0x06000275 RID: 629 RVA: 0x000058F8 File Offset: 0x00003AF8
public static Cache GetCacheAt(int cacheIndex)
{
Cache cache;
Caching.INTERNAL_CALL_GetCacheAt(cacheIndex, out cache);
return cache;
}
// Token: 0x06000276 RID: 630
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_GetCacheAt(int cacheIndex, out Cache value);
// Token: 0x06000277 RID: 631 RVA: 0x00005918 File Offset: 0x00003B18
public static Cache GetCacheByPath(string cachePath)
{
Cache cache;
Caching.INTERNAL_CALL_GetCacheByPath(cachePath, out cache);
return cache;
}
// Token: 0x06000278 RID: 632
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_GetCacheByPath(string cachePath, out Cache value);
// Token: 0x06000279 RID: 633 RVA: 0x00005938 File Offset: 0x00003B38
public static void GetAllCachePaths(List<string> cachePaths)
{
cachePaths.Clear();
for (int i = 0; i < Caching.cacheCount; i++)
{
cachePaths.Add(Caching.GetCacheAt(i).path);
}
}
// Token: 0x0600027A RID: 634 RVA: 0x00005978 File Offset: 0x00003B78
public static bool RemoveCache(Cache cache)
{
return Caching.INTERNAL_CALL_RemoveCache(ref cache);
}
// Token: 0x0600027B RID: 635
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool INTERNAL_CALL_RemoveCache(ref Cache cache);
// Token: 0x0600027C RID: 636 RVA: 0x00005994 File Offset: 0x00003B94
public static void MoveCacheBefore(Cache src, Cache dst)
{
Caching.INTERNAL_CALL_MoveCacheBefore(ref src, ref dst);
}
// Token: 0x0600027D RID: 637
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_MoveCacheBefore(ref Cache src, ref Cache dst);
// Token: 0x0600027E RID: 638 RVA: 0x000059A0 File Offset: 0x00003BA0
public static void MoveCacheAfter(Cache src, Cache dst)
{
Caching.INTERNAL_CALL_MoveCacheAfter(ref src, ref dst);
}
// Token: 0x0600027F RID: 639
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_MoveCacheAfter(ref Cache src, ref Cache dst);
// Token: 0x1700008B RID: 139
// (get) Token: 0x06000280 RID: 640
public static extern int cacheCount
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x1700008C RID: 140
// (get) Token: 0x06000281 RID: 641 RVA: 0x000059AC File Offset: 0x00003BAC
public static Cache defaultCache
{
get
{
Cache cache;
Caching.INTERNAL_get_defaultCache(out cache);
return cache;
}
}
// Token: 0x06000282 RID: 642
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_get_defaultCache(out Cache value);
// Token: 0x1700008D RID: 141
// (get) Token: 0x06000283 RID: 643 RVA: 0x000059CC File Offset: 0x00003BCC
// (set) Token: 0x06000284 RID: 644 RVA: 0x000059EC File Offset: 0x00003BEC
public static Cache currentCacheForWriting
{
get
{
Cache cache;
Caching.INTERNAL_get_currentCacheForWriting(out cache);
return cache;
}
set
{
Caching.INTERNAL_set_currentCacheForWriting(ref value);
}
}
// Token: 0x06000285 RID: 645
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_get_currentCacheForWriting(out Cache value);
// Token: 0x06000286 RID: 646
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_set_currentCacheForWriting(ref Cache value);
// Token: 0x06000287 RID: 647 RVA: 0x000059F8 File Offset: 0x00003BF8
[Obsolete("This WebPlayer function is not used any more.", true)]
public static bool Authorize(string name, string domain, long size, string signature)
{
return true;
}
// Token: 0x06000288 RID: 648 RVA: 0x00005A10 File Offset: 0x00003C10
[Obsolete("This WebPlayer function is not used any more.", true)]
public static bool Authorize(string name, string domain, long size, int expiration, string signature)
{
return true;
}
// Token: 0x06000289 RID: 649 RVA: 0x00005A28 File Offset: 0x00003C28
[Obsolete("This WebPlayer function is not used any more.", true)]
public static bool Authorize(string name, string domain, int size, int expiration, string signature)
{
return true;
}
// Token: 0x0600028A RID: 650 RVA: 0x00005A40 File Offset: 0x00003C40
[Obsolete("This WebPlayer function is not used any more.", true)]
public static bool Authorize(string name, string domain, int size, string signature)
{
return true;
}
// Token: 0x0600028B RID: 651 RVA: 0x00005A58 File Offset: 0x00003C58
[Obsolete("This function is obsolete. Please use ClearCache. (UnityUpgradable) -> ClearCache()")]
public static bool CleanCache()
{
return Caching.ClearCache();
}
// Token: 0x0600028C RID: 652 RVA: 0x00005A74 File Offset: 0x00003C74
[Obsolete("This API is not for public use.")]
public static bool CleanNamedCache(string name)
{
return false;
}
// Token: 0x0600028D RID: 653 RVA: 0x00005A8C File Offset: 0x00003C8C
[Obsolete("This function is obsolete and has no effect.")]
public static bool DeleteFromCache(string url)
{
return false;
}
// Token: 0x1700008E RID: 142
// (get) Token: 0x0600028E RID: 654 RVA: 0x00005AA4 File Offset: 0x00003CA4
[Obsolete("This property is only used by web player which is not used any more.", true)]
public static bool enabled
{
get
{
return true;
}
}
}
}