mirror of
https://gitea.tendokyu.moe/Kayori/Medusa.net.git
synced 2026-09-27 17:28:01 +03:00
- Refactor handler dispatch to use a parsed GameModel instead of raw model strings (Handler.cs, HandlerService.cs, new GameModel.cs) - Add a Unity asset-extraction subsystem (Abstractions/Extractors/Unity) - Add WriteEventLogHandler, XrpcDouble serialization type - Rename EaCoin*Handler -> *EaCoinHandler for naming consistency - Add PIN/username update and forgot/reset password flows, with a console-logging IEmailSender until real email is wired up - Add a settings page and a theming pass (theme tokens, tailwind config) - Add plugin nav/route/UI-manifest frontend types
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using Abstractions.Extractors.Unity.Helpers;
|
|
using Abstractions.Extractors.Unity.Models;
|
|
using AssetsTools.NET;
|
|
|
|
namespace Abstractions.Extractors.Unity.Services;
|
|
|
|
/// <summary>Walks an object's direct fields (and one level into any array fields) looking for
|
|
/// non-null PPtr references.</summary>
|
|
public static class DependencyResolver
|
|
{
|
|
public static List<ObjectDependency> GetObjectDependencies(AssetTypeValueField baseField)
|
|
{
|
|
var dependencies = new List<ObjectDependency>();
|
|
|
|
foreach (var child in baseField.Children)
|
|
{
|
|
if (ReflectionHelper.TryGetPPtr(child, out var pathId, out var fileId))
|
|
{
|
|
dependencies.Add(new ObjectDependency(child.FieldName, pathId, fileId));
|
|
continue;
|
|
}
|
|
|
|
var i = 0;
|
|
foreach (var element in BundleLoader.ArrayElements(child))
|
|
{
|
|
if (ReflectionHelper.TryGetPPtr(element, out var itemPathId, out var itemFileId))
|
|
dependencies.Add(new ObjectDependency($"{child.FieldName}[{i}]", itemPathId, itemFileId));
|
|
i++;
|
|
}
|
|
}
|
|
|
|
return dependencies;
|
|
}
|
|
}
|