Scripting API

Scripting API

AssetAddress

Class in Abyss.Core, from Abyss.Core.

What an addressable file is loaded by: its address, which a game names it by wherever the file is, and the labels it is found by among others.

public sealed class AssetAddress : IEquatable<AssetAddress>

Remarks

Kept in the file's sidecar, beside its identity, so moving or renaming the file keeps both; see AssetDatabase.SetAddress. A file with none is not addressable, and is loaded by its path as before.

An address is matched exactly, letter for letter and case for case, as a label is. It may not hold #, which is what names a piece of a file after its address — pyramid#Mesh0/Primitive0 — as it does after a path.

Its group is the pack it is built into: AssetAddress.DefaultGroup, the game's main pack, unless it is put in another; see AddressableSettings.

Constructors

AssetAddress

public AssetAddress(string address, IEnumerable<string>? labels = null, string? group = null)

An address, its labels and its group; the labels trimmed, each once, in order.

Parameters

Exceptions

Properties

Address

public string Address { get; }

What a game loads the file by.

Labels

public IReadOnlyList<string> Labels { get; }

What it is found by with others, in order; none for none.

Group

public string Group { get; }

The group it is built into the pack of: AssetAddress.DefaultGroup, or another.

InDefault

public bool InDefault { get; }

Whether it is in the main pack's group, AssetAddress.DefaultGroup.

Methods

Problem

public static string? Problem(string address)

What is wrong with an address, or null for nothing.

Parameters

  • address: The address as it would be kept.

Simplified

public static string Simplified(string path)

The address a path is simplified to: the file's name, its folders and extension taken off.

Parameters

  • path: The file's path: prefabs/enemy.prefab is enemy.

With

public AssetAddress With(IEnumerable<string> labels)

The same address and group with labels in place of its own.

Parameters

  • labels

At

public AssetAddress At(string address)

The same labels and group under address.

Parameters

  • address

In

public AssetAddress In(string group)

The same address and labels in group.

Parameters

  • group

Equals

public bool Equals(AssetAddress? other)

Parameters

  • other

Equals

public override bool Equals(object? obj)

Parameters

  • obj

GetHashCode

public override int GetHashCode()

ToString

public override string ToString()

The address, its labels after it, and its group if it is not the default.

Constants

DefaultGroup

public const string DefaultGroup = "Default"

The group what says none is in: the game's main pack.