Class ResourceEditorUtils
public static class ResourceEditorUtils
- Inheritance
-
ResourceEditorUtils
- Inherited Members
Methods
AddAsset(AddressableAssetGroup, Object, params string[])
Add an asset to the specified addressable asset group with optional labels
public static AddressableAssetEntry AddAsset(this AddressableAssetGroup group, Object asset, params string[] labels)
Parameters
groupAddressableAssetGroupThe addressable asset group to add the asset to
assetObjectThe asset to add
labelsstring[]Optional labels to assign to the asset
Returns
- AddressableAssetEntry
The created addressable asset entry or null if failed
CleanupAssetGroup(AddressableAssetGroup)
Remove all asset entries from the specified addressable asset group
public static void CleanupAssetGroup(AddressableAssetGroup assetGroup)
Parameters
assetGroupAddressableAssetGroupThe addressable asset group to clean up
DeleteAsset(string)
public static void DeleteAsset(string path)
Parameters
pathstring
DeleteDirectory(string)
public static void DeleteDirectory(string path)
Parameters
pathstring
FindAssetEntry(string, Type)
Find an addressable asset entry by address and asset type
public static AddressableAssetEntry FindAssetEntry(string address, Type assetType)
Parameters
Returns
- AddressableAssetEntry
The matching addressable asset entry or null if not found
GetAssetGUID(Object)
Get the GUID of a Unity asset
public static string GetAssetGUID(this Object asset)
Parameters
assetObjectThe Unity object to get GUID for
Returns
- string
The asset GUID string
GetOrCreateAssetGroup(string, bool)
Get existing addressable asset group or create a new one if it doesn't exist
public static AddressableAssetGroup GetOrCreateAssetGroup(string groupName, bool createIfNotExist = true)
Parameters
groupNamestringThe name of the group to get or create
createIfNotExistboolCreate the group if not exist
Returns
- AddressableAssetGroup
The addressable asset group
Modify(AddressableAssetGroup, bool)
Create a modification scope and marks the group as modified when any entry was added in the scope.
public static ResourceEditorUtils.AssetGroupModificationScope Modify(this AddressableAssetGroup group, bool postEvent = false)
Parameters
groupAddressableAssetGroupThe addressable asset group to modify
postEventboolWhether to post modification events
Returns
- ResourceEditorUtils.AssetGroupModificationScope
A disposable scope for managing group modifications
RemoveAssetGroups(AddressableAssetGroup[])
Remove multiple addressable asset groups from the settings
public static void RemoveAssetGroups(AddressableAssetGroup[] assetGroups)
Parameters
assetGroupsAddressableAssetGroup[]The list of addressable asset groups to remove
ToAddressableAssetEntry(Object)
Convert a Unity object to its corresponding addressable asset entry
public static AddressableAssetEntry ToAddressableAssetEntry(this Object asset)
Parameters
assetObjectThe Unity object to convert
Returns
- AddressableAssetEntry
The addressable asset entry or null if not found