Class AssetUtility
public static class AssetUtility
- Inheritance
-
AssetUtility
- Inherited Members
Methods
FindAsset<TAsset>(string, out int, bool)
public static TAsset? FindAsset<TAsset>(string name, out int numberOfSimilarNames, bool additionalCheckWithoutNonAlphanumericCharacters = true) where TAsset : Asset
Parameters
Returns
- TAsset
Type Parameters
TAsset
GetAssetCategory(Type)
Returns the asset category (SDG.Unturned.EAssetType) of assetType.
[Pure]
public static EAssetType GetAssetCategory(Type assetType)
Parameters
assetTypeType
Returns
- EAssetType
GetAssetCategory<TAsset>()
Returns the asset category (SDG.Unturned.EAssetType) of TAsset. Efficiently cached.
[Pure]
public static EAssetType GetAssetCategory<TAsset>() where TAsset : Asset
Returns
- EAssetType
Type Parameters
TAsset
GetAssetCategory<TAsset>(TAsset)
Returns the asset category (SDG.Unturned.EAssetType) of TAsset. Efficiently cached usually.
[Pure]
public static EAssetType GetAssetCategory<TAsset>(TAsset asset) where TAsset : Asset
Parameters
assetTAsset
Returns
- EAssetType
Type Parameters
TAsset
GetItemType(ClothingType)
public static EItemType GetItemType(this ClothingType type)
Parameters
typeClothingType
Returns
- EItemType
Exceptions
- ArgumentOutOfRangeException
Thrown if
typeis not a valid value.
LoadAsset(string, AssetOrigin)
Synchronously loads an asset file.
public static string[]? LoadAsset(string filePath, AssetOrigin origin)
Parameters
filePathstringoriginAssetOrigin
Returns
- string[]
A list of all errors.
ReadFileWithoutHash(string)
public static IDatDictionary ReadFileWithoutHash(string path)
Parameters
pathstring
Returns
- IDatDictionary
SyncAssetsFromOrigin(AssetOrigin)
public static void SyncAssetsFromOrigin(AssetOrigin origin)
Parameters
originAssetOrigin
TryGetAsset<TAsset>(string, out TAsset?, out bool, bool, Predicate<TAsset>?)
public static bool TryGetAsset<TAsset>(string assetName, out TAsset? asset, out bool multipleResultsFound, bool allowMultipleResults = false, Predicate<TAsset>? selector = null) where TAsset : Asset
Parameters
assetNamestringassetTAssetmultipleResultsFoundboolallowMultipleResultsboolselectorPredicate<TAsset>
Returns
Type Parameters
TAsset
TryGetAssets<TAsset>(string, Predicate<TAsset>?, bool)
public static List<TAsset> TryGetAssets<TAsset>(string assetName, Predicate<TAsset>? selector = null, bool pool = false) where TAsset : Asset
Parameters
Returns
- List<TAsset>
Type Parameters
TAsset