Scripting API

Scripting API

AssetRef<T>

Struct in Abyss.Core, from Abyss.Core.

A reference to a data asset of T, by its identity: a slot in the Inspector that takes only those, read with World.Data. Laid out as a PrefabRef is, the identity's two halves.

public readonly struct AssetRef<T> where T : unmanaged

Type parameters

Constructors

AssetRef

public AssetRef(AssetGuid id)

A reference to the asset id.

Parameters

  • id

AssetRef

public AssetRef(ulong low, ulong high)

A reference made of its identity's two halves, as a field holds them.

Parameters

  • low
  • high

Properties

None

public static AssetRef<T> None { get; }

A reference to nothing.

IsNone

public bool IsNone { get; }

Whether it names nothing.

Id

public AssetGuid Id { get; }

The identity of the asset it names.

Low

public ulong Low { get; }

The identity's first half, as the field holds it.

High

public ulong High { get; }

The identity's second half, as the field holds it.

Methods

Equals

public bool Equals(AssetRef<T> other)

Parameters

  • other

Equals

public override bool Equals(object? obj)

Parameters

  • obj

GetHashCode

public override int GetHashCode()

ToString

public override string ToString()

Operators

operator ==

public static bool operator ==(AssetRef<T> left, AssetRef<T> right)

Whether two name the same asset.

Parameters

  • left
  • right

operator !=

public static bool operator !=(AssetRef<T> left, AssetRef<T> right)

Whether two name other assets.

Parameters

  • left
  • right