Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find MonoBehaviours attached to components in any given scene #6

Open
just-ero opened this issue Oct 16, 2022 · 0 comments
Open

Find MonoBehaviours attached to components in any given scene #6

just-ero opened this issue Oct 16, 2022 · 0 comments
Assignees
Labels
area: unity help wanted Issue requires advanced knowledge.

Comments

@just-ero
Copy link
Owner

Unity's model highly encourages not using any static instances of classes, but instead, to attach a MonoBehaviour to a GameObject, Component, ScriptableObject, etc. Unfortunately, this makes asl-help-unity completely unable to function for classes and games like that.

Luckily, there are ways to find these attached classes within the scene. Each Unity Scene (the C++ versions) contains a linked list of loaded GameObjects. These objects are often loaded in the same order every time. Each of these GameObjects contains an array of attached Components. These components contain the scripts, which finally get linked to the actual MonoClass.

Some helpful code can be found at Micrologist/UnityInstanceDumper.

@just-ero just-ero added area: unity help wanted Issue requires advanced knowledge. labels Oct 16, 2022
@just-ero just-ero self-assigned this Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: unity help wanted Issue requires advanced knowledge.
Projects
None yet
Development

No branches or pull requests

1 participant