AssetSystem
public static abstract sealed class AssetSystem The asset system, provides access to all the assets.
Properties
| Name | Type | Description |
|---|---|---|
All static | IEnumerable<Asset> | All the assets that are being tracked by the asset system. Does not include deleted assets. |
Methods
static Task<Asset> InstallAsync(String packageIdent, Boolean skipIfInstalled = True, Action<Single> loading = null, CancellationToken token = null) static Task<Asset> InstallAsync(Package package, Boolean skipIfInstalled = True, Action<Single> loading = null, CancellationToken token = null) static IRevision GetInstalledRevision(String packageIdent) Gets the locally installed package revision by ident
static Boolean IsCloudInstalled(String packageIdent) Is this package installed in our cloud directory?
static Boolean IsCloudInstalled(Package package, Boolean exactVersion = False) Is a version this package installed in our cloud directory?
static IReadOnlyCollection<Package> GetInstalledPackages() Get all packages in the download cache
static IReadOnlyCollection<Package> GetReferencedPackages() Get all packages, referenced by assets in the current project, in the download cache
static IReadOnlyCollection<String> GetPackageFiles(Package package) static Boolean CanCloudInstall(Package package) Is this package type something we can install?
static Boolean CompileResource(String path, String text) Compile a resource from text.
static Boolean CompileResource(String path, ReadOnlySpan<Byte> data) static Asset FindByPath(String path) Find an asset by path.
path — The file path to an asset. Can be absolute or relative. static Asset RegisterFile(String absoluteFilePath) If you just created an asset, you probably want to immediately register it
static Void DeleteOrphans() Delete orphaned trivial children. These are things that are generated for usage by an asset, but aren't referenced by anything, so are useless.
static Asset CreateResource(String type, String absoluteFilename) Create an empty GameResource.
type — Asset type extension for our new GameResource instance. absoluteFilename — Where to save the new GameResource instance. For example from FileDialog. static Asset CreateEmbeddedAsset(SerializedProperty target) Create an Asset from a serialized property. This is expected to be an embedded asset property.