AssetSystemclass

The asset system, provides access to all the assets.

objectAssetSystem
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public static abstract sealed class Editor.AssetSystem

Methods16

Showing 16 methods

public static bool CanCloudInstall(Sandbox.Package package)PUBLICSTATIC

Is this package type something we can install?

ParameterTypeDescription
packagePackage
Returns:bool

public static Editor.Asset CreateEmbeddedAsset(Sandbox.SerializedProperty target)PUBLICSTATIC

Create an Asset from a serialized property. This is expected to be an embedded asset property.

ParameterTypeDescription
targetSerializedProperty
Returns:Asset

public static Editor.Asset CreateResource(string type, string absoluteFilename)PUBLICSTATIC

Create an empty `Sandbox.GameResource`.

ParameterTypeDescription
typestringAsset type extension for our new `Sandbox.GameResource` instance.
absoluteFilenamestringWhere to save the new `Sandbox.GameResource` instance. For example from `Editor.FileDialog`.
Returns:AssetThe new asset, or null if creation failed.

public static void DeleteOrphans()PUBLICSTATIC

Delete orphaned trivial children. These are things that are generated for usage by an asset, but aren't referenced by anything, so are useless.

Returns:void

public static Editor.Asset FindByPath(string path)PUBLICSTATIC

Find an asset by path.

ParameterTypeDescription
pathstringThe file path to an asset. Can be absolute or relative.
Returns:Asset

public static System.Collections.Generic.IReadOnlyCollection`1<Sandbox.Package> GetInstalledPackages()PUBLICSTATIC

Get all packages in the download cache

Returns:IReadOnlyCollection<Package>

public static Sandbox.Package.IRevision GetInstalledRevision(string packageIdent)PUBLICSTATIC

Gets the locally installed package revision by ident

ParameterTypeDescription
packageIdentstring
Returns:IRevision

public static System.Collections.Generic.IReadOnlyCollection`1<string> GetPackageFiles(Sandbox.Package package)PUBLICSTATIC

ParameterTypeDescription
packagePackage
Returns:IReadOnlyCollection<string>

public static System.Collections.Generic.IReadOnlyCollection`1<Sandbox.Package> GetReferencedPackages()PUBLICSTATIC

Get all packages, referenced by assets in the current project, in the download cache

Returns:IReadOnlyCollection<Package>

public static Editor.Asset RegisterFile(string absoluteFilePath)PUBLICSTATIC

If you just created an asset, you probably want to immediately register it

ParameterTypeDescription
absoluteFilePathstring
Returns:Asset

Properties1

Showing 1 properties

public static System.Collections.Generic.IEnumerable`1<Editor.Asset> Editor.AssetSystem.All { get; set; }PUBLICSTATICGETSET

All the assets that are being tracked by the asset system. Does not include deleted assets.

Returns:IEnumerable<Asset>

On this page

Methodspublic static System.Boolean CanCloudInstall(Sandbox.Package package)public static System.Boolean CompileResource(System.String path, System.ReadOnlySpan`1<System.Byte> data)public static System.Boolean CompileResource(System.String path, System.String text)public static Editor.Asset CreateEmbeddedAsset(Sandbox.SerializedProperty target)public static Editor.Asset CreateResource(System.String type, System.String absoluteFilename)public static System.Void DeleteOrphans()public static Editor.Asset FindByPath(System.String path)public static System.Collections.Generic.IReadOnlyCollection`1<Sandbox.Package> GetInstalledPackages()public static Sandbox.Package.IRevision GetInstalledRevision(System.String packageIdent)public static System.Collections.Generic.IReadOnlyCollection`1<System.String> GetPackageFiles(Sandbox.Package package)public static System.Collections.Generic.IReadOnlyCollection`1<Sandbox.Package> GetReferencedPackages()public static System.Threading.Tasks.Task`1<Editor.Asset> InstallAsync(Sandbox.Package package, System.Boolean skipIfInstalled = True, System.Action`1<System.Single> loading = null, System.Threading.CancellationToken token = null)public static System.Threading.Tasks.Task`1<Editor.Asset> InstallAsync(System.String packageIdent, System.Boolean skipIfInstalled = True, System.Action`1<System.Single> loading = null, System.Threading.CancellationToken token = null)public static System.Boolean IsCloudInstalled(Sandbox.Package package, System.Boolean exactVersion = False)public static System.Boolean IsCloudInstalled(System.String packageIdent)public static Editor.Asset RegisterFile(System.String absoluteFilePath)Propertiespublic static System.Collections.Generic.IEnumerable`1<Editor.Asset> Editor.AssetSystem.All { get; set; }Metadata