Scripting API

Scripting API

FileRef

Struct in Abyss.Core, from Abyss.Core.

A file a component names that the engine has no kind of its own for — what a package bakes and reads back itself, a navmesh — kept by its identity, which the inspector's slot is given by dragging the file onto it from the Project panel, or by the code that made the file.

public readonly struct FileRef

Remarks

An identity, not a path, so moving or renaming the file never breaks it: a scene writes the path beside it, which is what it falls back on when the identity is not found. A built game's pack carries every file a scene's reference reaches, as it is, and World.ReadFile reads it from there, or from the project's folders while the game is edited or played from them.

Which files a slot takes is said by FileKindAttribute on the field: those ending in its extension. Sixteen bytes, described as one field of two whole numbers, as a PrefabRef is.

Constructors

FileRef

public FileRef(AssetGuid id)

A reference to the file of id.

Parameters

  • id

Properties

None

public static FileRef None { get; }

No file.

IsNone

public bool IsNone { get; }

Whether this names no file.

Id

public AssetGuid Id { get; }

The file's identity; AssetGuid.None for none.

Methods

Equals

public bool Equals(FileRef other)

Parameters

  • other

Equals

public override bool Equals(object? obj)

Parameters

  • obj

GetHashCode

public override int GetHashCode()

ToString

public override string ToString()

The identity, or none.

Operators

operator ==

public static bool operator ==(FileRef left, FileRef right)

Two references to one file.

Parameters

  • left
  • right

operator !=

public static bool operator !=(FileRef left, FileRef right)

Two references to different files.

Parameters

  • left
  • right