s&box docs

public static abstract sealed class Editor.AssetSystem

The asset system, provides access to all the assets.

Broader workflow and conceptual references connected to this API.

Methods

Showing 16 methods

public static bool CanCloudInstall(Sandbox.Package package)

Is this package type something we can install?

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

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

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

Create an empty `Sandbox.GameResource`.

Parameters

  • type: Asset type extension for our new `Sandbox.GameResource` instance.
  • absoluteFilename: Where to save the new `Sandbox.GameResource` instance. For example from `Editor.FileDialog`.

Returns

The new asset, or null if creation failed.

public 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.

public static Editor.Asset FindByPath(string path)

Find an asset by path.

Parameters

  • path: The file path to an asset. Can be absolute or relative.

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

Get all packages in the download cache

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

Gets the locally installed package revision by ident

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

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

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

public static Editor.Asset RegisterFile(string absoluteFilePath)

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

Properties

Showing 1 properties

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

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

Metadata

FieldValue
NamespaceEditor
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.AssetSystem

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