Scripting API

Scripting API

AssetKey

Class in Abyss.Core, from Abyss.Core.

An addressable asset as the build names it in a game's code — Addresses.Scenes.Moons — its address and its identity: of one kind of asset each, so a clip given where a prefab goes is a build error, and a key whose asset went is one where it is used.

public abstract class AssetKey

Remarks

Written by the build from the assets' sidecars, a key for each addressable file and each clip of an addressable model; see AddressCodeNames for how each is named.

Found by its identity first, wherever the file is now, then by its address: a file moved, or its address changed, while the game's code was not built again, is still found.

Not a string. No conversion to one is given, since it would let a key pass where any address is taken; AssetKey.Address says it, as AssetKey.ToString does. A game's code loads assets by keys alone: a string load is a build error (ABYSS026).

Kept as its identity. What a game saves of an asset — the hat a player bought — is its key's AssetKey.Id, which a key of its kind is made from again: PrefabAddress.FromId(id). It is the file's for good, wherever the file moves and whatever it is renamed.

Properties

Address

public string Address { get; }

What it is loaded by, a piece of a file after # included.

Id

public AssetGuid Id { get; }

The identity of its file; AssetGuid.None for a key found by its address alone.

Methods

ToString

public override string ToString()