Vixen
02b45cc4
csharp
public readonly record struct AssetReference

One asset pointing at another, as it appears in a .vxscene, .vxmat or prefab.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A single scalar, and that is not cosmetics. albedo: vx:9e8a44c9930c64e388ca034c5fe4c426 mesh: vx:1a2b3c4d5e6f70819a2b3c4d5e6f7081#2b9e5f13 material: null Unity writes the same thing as a three-key flow mapping. One scalar diffs on one line, merges cleanly, and greps trivially — rg 'vx:9e8a44c9' finds every referrer, which is the question anyone asks before deleting an asset. Unity's type: field is dropped, because nothing reads it.

The vx: prefix marks it as a reference to both the parser and a human reading a diff. Without it a GUID is indistinguishable from any other hex string in the file.

Fields and properties (6)

  • public AssetId Asset

    Which asset.

  • public SubAssetId SubAsset

    Which object inside it, or Main for the main one.

  • public const string Prefix

    The prefix that marks a scalar as a reference.

  • public const int MaxTextLength

    How long the text form can be: the prefix, a GUID, a hash and a sub-asset id.

  • public static AssetReference Null

    A reference to nothing.

  • public bool IsNull

    Whether it points at anything.

Methods (11)

  • public AssetReference(AssetId Asset, SubAssetId SubAsset)

    One asset pointing at another, as it appears in a .vxscene, .vxmat or prefab.

  • public AssetReference(AssetId asset)

    Points at an asset's main object.

  • public override string ToString()

    Renders the reference, or null if it points at nothing.

  • public string ToString(string? format, IFormatProvider? formatProvider)

    Formats the value of the current instance using the specified format.

  • public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider? provider = null)

    Tries to format the value of the current instance into the provided span of characters.

  • public static AssetReference Parse(string s, IFormatProvider? provider = null)

    Parses a string into a value.

  • public static AssetReference Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)

    Parses a span of characters into a value.

  • public static bool TryParse(string? s, IFormatProvider? provider, out AssetReference result)

    Tries to parse a string into a value.

  • public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out AssetReference result)

    Tries to parse a span of characters into a value.

  • public static bool TryParse(string? s, out AssetReference result)

    Parses a reference, or null.

  • public static bool TryParse(ReadOnlySpan<char> s, out AssetReference result)

    Parses a reference, or null.

Used by (96, showing 40)

  • GameModelsThirdPersonShooter
  • AssetManagerVixen.Assets
  • AssetManagerTestsVixen.Assets.Tests
  • AssetMaterialSourceVixen.Engine.Renderer
  • AssetMaterialSourceTestsVixen.Engine.Renderer.Tests
  • AssetMeshSourceVixen.Engine.Renderer
  • AssetReferenceSerializerVixen.Core.Serialization
  • AssetTerrainTexturesVixen.Engine.Renderer
  • AssetTextureSourceVixen.Engine.Renderer
  • AssetTextureSourceTestsVixen.Engine.Renderer.Tests
  • AssetVfxEffectSourceVixen.Engine.Renderer
  • AssetVirtualGeometrySourceVixen.Engine.Renderer
  • CatalogEntryVixen.Assets
  • CatalogFormatVixen.Assets
  • CatalogFormatTestsVixen.Assets.Tests
  • CatalogReferenceTestsVixen.Assets.Tests
  • ContentCatalogVixen.Assets
  • DeferredClusterVixen.Rendering.Tests
  • DeferredMaterialVixen.Rendering.Tests
  • DeferredMeshSourceVixen.Engine.Renderer.Tests
  • EveryMeshVixen.Rendering.Tests
  • GeometryKeyVixen.Rendering
  • IMaterialSourceVixen.Rendering
  • IMeshSourceVixen.Rendering
  • ISurfaceSourceVixen.Rendering
  • IVfxEffectSourceVixen.Rendering
  • IVirtualGeometrySourceVixen.Rendering
  • MaterialVixen.Core.Yaml.Tests
  • MaterialTextureVixen.Rendering
  • MeshDataVixen.Rendering
  • MeshExtractionSystemVixen.Rendering
  • MeshExtractionTestsVixen.Rendering.Tests
  • MeshRenderableVixen.Rendering
  • MeshRenderablesVixen.Rendering
  • MetaTestsVixen.Core.Yaml.Tests
  • NoClustersVixen.Rendering.Tests
  • OneClusterVixen.Rendering.Tests
  • OneMaterialVixen.Rendering.Tests
  • OneMeshVixen.Rendering.Tests
  • PaintVixen.Engine.Renderer