Publish original pickup prefab through CultMesh assets

This commit is contained in:
Meta Vens 2026-07-11 19:17:13 +01:00
commit ea771de61a
3 changed files with 30 additions and 5 deletions

View file

@ -822,7 +822,8 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
RequireEqual("salvage", pickupNode.Props["itemKey"], "Eve pickup must expose item identity");
Require(double.Parse(pickupNode.Props["remainingLifetime"], CultureInfo.InvariantCulture) < 30,
"Eve pickup must expose daemon-owned remaining lifetime");
Require(AetheriaRuntimeAssets.ProjectManifest(null).Assets.Any(asset => asset.Ref.AssetKey == "prefab.entity.pickup"),
var pickupAsset = AetheriaRuntimeAssets.ProjectManifest(null).Assets.Single(asset => asset.Ref.AssetKey == "prefab.entity.pickup");
Require(pickupAsset.Ref.Metadata.TryGetValue("unityAssetPath", out var pickupPath) && pickupPath == "Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab",
"provider asset manifest must advertise the pickup visual used by Eve");
}

View file

@ -1887,10 +1887,12 @@ static EveAssetCatalogDocument BuildCoreAssetCatalog(
var assets = (source.Assets ?? Array.Empty<AetheriaRuntimeAssetManifestEntry>())
.Where(entry => entry?.Ref != null &&
string.Equals(entry.Ref.Kind, AetheriaRuntimeAssetKinds.Prefab, StringComparison.Ordinal) &&
entry.Ref.Metadata.TryGetValue("resourcesPath", out _))
(entry.Ref.Metadata.TryGetValue("resourcesPath", out _) || entry.Ref.Metadata.TryGetValue("unityAssetPath", out _)))
.Select(entry =>
{
var resourcesPath = entry.Ref.Metadata["resourcesPath"];
var unityAssetPath = entry.Ref.Metadata.TryGetValue("unityAssetPath", out var explicitPath)
? explicitPath
: $"Assets/Resources/{entry.Ref.Metadata["resourcesPath"]}.prefab";
return new EveAssetCatalogEntry(
entry.Ref.AssetKey,
entry.Ref.Kind,
@ -1901,7 +1903,7 @@ static EveAssetCatalogDocument BuildCoreAssetCatalog(
bundle.Uri,
bundle.Hash,
bundle.Size,
$"Assets/Resources/{resourcesPath}.prefab",
unityAssetPath,
new Dictionary<string, string>(StringComparer.Ordinal)
{
["view.pilot.excludeUnityLayers"] = "14"

View file

@ -27,7 +27,7 @@ namespace GameCult.Aetheria.State.Verse
Add(entries, MapPrefab("prefab.entity.station", "Station", "Prefabs/Stations/AsteroidOutpost"));
Add(entries, MapPrefab("prefab.entity.orbital", "Orbital", "Prefabs/Stations/Zenith"));
Add(entries, MapPrefab("prefab.entity.projectile", "Projectile", "Prefabs/Lightning"));
Add(entries, MapPrefab("prefab.entity.pickup", "Pickup", "Assets/Prefabs/RPG/Pickups/Tetrahedron"));
Add(entries, MapProjectPrefab("prefab.entity.pickup", "Pickup", "Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab"));
foreach (var inventoryAsset in InventoryUiAssets())
Add(entries, inventoryAsset);
@ -173,6 +173,28 @@ namespace GameCult.Aetheria.State.Verse
};
}
private static AetheriaRuntimeAssetManifestEntry MapProjectPrefab(
string key,
string label,
string unityAssetPath)
{
return new AetheriaRuntimeAssetManifestEntry
{
Ref = new AetheriaRuntimeAssetRef
{
AssetKey = key,
Kind = AetheriaRuntimeAssetKinds.Prefab,
Uri = CultMeshAssetUri(key),
MimeType = "application/vnd.unity.prefab",
Metadata = new Dictionary<string, string>(StringComparer.Ordinal)
{
["unityAssetPath"] = (unityAssetPath ?? "").Replace('\\', '/')
}
},
Tags = new[] { "world", "prefab", label }
};
}
private static AetheriaRuntimeAssetRef Sprite(string key, string resourcePath)
{
return CultMeshAssetRef(