Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Analyze command - track "SerializeReference" usage

Ouverte
#53 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
csharp, unity
Domaine
data, devtools

Piste de recherche

Commencez par la commande Analyze et examinez les implémentations existantes des tables mono_script et refs, ainsi que de script_object_view. Définissez la nouvelle table SerializeReference et une ou plusieurs vues pour les champs demandés MonoBehaviour, object, asset, riid, size, class, namespace et assembly, puis mettez à jour la documentation avec la table, la vue et le cas d’utilisation du renommage de classes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

The SerializeReference feature of Unity Serialization means that additional C# classes can be serialized directly inside MonoBehaviours and ScriptableObjects. These object instances are called "Managed References" (although SerializeReference is the more visible name because that is the C# attribute)

More docs about this feature:
https://docs.unity3d.com/6000.6/Documentation/ScriptReference/SerializeReference.html

They do not use MonoScripts to managed the C# type - instead the C# type info is serialized directly into the serialized reference registry of the MonoBehaviour.

So the information about what types are actually used is spread all over the place in the built content, and it is difficult to see it.

Management of these objects can be a challenge, often we have to do text searching of the YAML format in the project assets to find them. In binary data its quite hard to "find" them without actually loading the content.

One example for wanting to find them is if you want to rename a class and need to confirm that the old name is not present anywhere in your assetbundles.

This feature idea is to add another table similar to the recently introduced mono_script table.

When we enumerate MonoBehaviour objects when we discover a SerializeReference instance we will add a row to the new table that has the assembly name, namespace and class, the riid, and the id of the MonoBehaviour. Ideally we would also capture the size of the serialized data for that object.

This approach will automatically catch managed reference objects on ScriptableObjects, because that C# class is also presented as MonoBehaviours in serialized data, e.g. they are the same native object.

This implementation should be somewhat similar to how references are captured and recorded in the refs table, so it should be possible to implement in UnityDataTools without introducing any new concepts or complexity. Our typetree walking code already knows how to parse all serialized forms of the ManagedReferenceRegistry, so it should not be hard to report them as we parse them, during object analysis.

  • As part of this task also introduce one or more views that shows information from the new table, similar to the new script_object_view.
    E.g. a view that shows all SerializeReference objects with these fields:

monobehaviour object id, MonoBehavior name, archive, serialized file, Class, NameSpace, Assembly Name, managed reference id ("rid"), size

  • Also update documentation to talk about the new table / view and use case for using it.
Langage dominant
C#
Étoiles
825
Forks
72
Merge moyen
20 h 16 min
PR mergées (30 j)
13

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Unity-Technologies/UnityDataTools

Toutes les issues de Unity-Technologies/UnityDataTools

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.