Vixen
02b45cc4
csharp
public static class SubAssets

Where a sub-asset's id comes from.

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

Remarks

From what the sub-asset is — the importer, the kind, the name — and never from where it landed in the source file. That is the one piece of Unity's behaviour worth keeping while discarding its representation. Unity's fileID values are internal magic numbers, so re-exporting an FBX whose mesh order changed renumbers everything and silently breaks every reference; "my prefab lost its mesh after an artist re-exported" is one of the most common failures in real projects, and it is avoidable by construction.

XxHash32, because the id has to be identical on every machine and every run. A string.GetHashCode() is randomised per process and would give each developer a different project.

Methods (2)

  • public static SubAssetId Derive(string importerType, string kind, string name)

    Derives a sub-asset's id.

  • public static void EnsureDistinct(IEnumerable<SubAssetEntry> entries)

    Checks that no two entries claim one id.

Used by (6)

  • MetaTestsVixen.Core.Yaml.Tests
  • BuildPlannerTestsVixen.Editor.Assets.Tests
  • ImportContextVixen.Editor.Assets
  • ImportPipelineTestsVixen.Editor.Assets.Tests
  • ImporterTestsVixen.Editor.Assets.Tests
  • PlannedProjectVixen.Editor.Assets.Tests