Class Util
- Namespace
- TAssetBundle
- Assembly
- TAssetBundle.dll
public static class Util
- Inheritance
-
Util
- Inherited Members
Methods
BytesToHexString(byte[])
Converts a byte array to a hexadecimal string.
public static string BytesToHexString(byte[] bytes)
Parameters
bytes
byte[]Byte array to convert
Returns
- string
Hexadecimal string
ClearCachedAssets()
Clears the cached assets.
public static void ClearCachedAssets()
ClearCachedRemoteCatalogs()
Clears cached remote catalogs.
public static void ClearCachedRemoteCatalogs()
Compress(byte[])
Compresses a byte array.
public static byte[] Compress(byte[] inputData)
Parameters
inputData
byte[]Byte array to compress
Returns
- byte[]
Compressed byte array
CreateDirectoryFromFilePath(string)
Creates a directory based on the given file path.
public static void CreateDirectoryFromFilePath(string filePath)
Parameters
filePath
stringFile path
Decompress(byte[])
Decompresses a byte array.
public static byte[] Decompress(byte[] inputData)
Parameters
inputData
byte[]Byte array to decompress
Returns
- byte[]
Decompressed byte array
DecryptRijndael(byte[], byte[], byte[])
Decrypts a byte array using Rijndael encryption.
public static byte[] DecryptRijndael(byte[] bytes, byte[] key, byte[] iv)
Parameters
Returns
- byte[]
Decrypted byte array
EncryptRijndael(byte[], byte[], byte[])
Encrypts a byte array using Rijndael encryption.
public static byte[] EncryptRijndael(byte[] bytes, byte[] key, byte[] iv)
Parameters
Returns
- byte[]
Encrypted byte array
GetAssetBundleName(string, string)
Returns the asset bundle name with hash.
public static string GetAssetBundleName(string assetBundleName, string hash)
Parameters
Returns
- string
Asset bundle name
GetAssetBundleName(string, string, bool)
Returns the asset bundle name with hash if required.
public static string GetAssetBundleName(string assetBundleName, string hash, bool withHash)
Parameters
assetBundleName
stringAsset bundle name
hash
stringHash value
withHash
boolWhether to include hash in the name
Returns
- string
Asset bundle name
GetDataPath(string)
Returns the data path for a given relative path.
public static string GetDataPath(string relativePath = "")
Parameters
relativePath
stringRelative path
Returns
- string
Full data path
GetMD5Hash(byte[])
Returns the MD5 hash of a byte array.
public static string GetMD5Hash(byte[] bytes)
Parameters
bytes
byte[]Byte array to compute MD5 hash
Returns
- string
MD5 hash string
GetMD5HashFromFile(string)
Returns the MD5 hash of a file at a specified path.
public static string GetMD5HashFromFile(string filePath)
Parameters
filePath
stringFile path to compute MD5 hash
Returns
- string
MD5 hash string
GetMD5HashFromString(string)
Returns the MD5 hash of a string.
public static string GetMD5HashFromString(string inputString)
Parameters
inputString
stringString to compute MD5 hash
Returns
- string
MD5 hash string
GetSHA256HashFromString(string)
Returns the SHA256 hash of a string.
public static byte[] GetSHA256HashFromString(string inputString)
Parameters
inputString
stringString to compute SHA256 hash
Returns
- byte[]
SHA256 hash byte array