Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MarkAsUsed

Bumps the timestamp of a cached file to be the current time.
Read time 1 minuteLast updated 11 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

MarkAsUsed(string, int)

Bumps the timestamp of a cached file to be the current time.
Warning
Deprecated. Please use MarkAsUsed with Hash128 instead.
public static bool MarkAsUsed(string url, int version)

Parameters

The filename of the AssetBundle. Domain and path information are stripped from this string automatically.

version

The version number of the AssetBundle to mark as recently used.

Returns

Type

Description

boolTrue if the specified AssetBundle version is in the cache. Otherwise, false.

Remarks

This allows you to keep files in the cache even if you are not explicitly loading them. Returns true if the url is cached.

MarkAsUsed(string, Hash128)

Bumps the timestamp of a cached file to be the current time.
public static bool MarkAsUsed(string url, Hash128 hash)

Parameters

The filename of the AssetBundle. Domain and path information are stripped from this string automatically.

hash

Hash128
The version hash of the AssetBundle to mark as recently used.

Returns

Type

Description

boolTrue if the specified AssetBundle version is in the cache. Otherwise, false.

Remarks

This allows you to keep files in the cache even if you are not explicitly loading them.

MarkAsUsed(CachedAssetBundle)

Bumps the timestamp of a cached file to be the current time.
public static bool MarkAsUsed(CachedAssetBundle cachedBundle)

Parameters

cachedBundle

A CachedAssetBundle struct that pairs the AssetBundle name with the version hash to mark as recently used.

Returns

Type

Description

boolTrue if the specified AssetBundle version is in the cache. Otherwise, false.

Remarks

This allows you to keep files in the cache even if you are not explicitly loading them.