Is there any way I can dump whole GameObject tree in runtime?

I have been working for building a tool under iOS to get whole GameObject tree(including Scene).

I have already learned out that I could create a pseudo object, just let MainCamera mount it, and inside the pseudo object I could just setup a RPC server and let the object do the rest work.

However, I think the way above is too complicated and needs to be integrated by the original game project manually. So I’m looking for a way without involving the game project.

I once thought using UnityFramework could help, but there were no helpful things(including unity_send_message).

Hope to get something helpful ! Thanks a lot !

What do you mean by “dump”? And what does it have to do with networking?

1 Like

“dump” means get the whole GameObject or Scene hierachy and those objects’ information such as tag, name, text, rect

“networking” is just a cross framework communicating method to deliver information above from inside unity to native, it’s okay to use other mechanisms.

Ok but are you trying to serialize the whole scene hierarchy, or just traverse it in code?

Actually I’m looking forward to a mechanism to get inside information of GameObjects, hierarchy is just a demonstration .

Something like unium not quite matches my request.

Every GameObject has a Transform component that contains a list of its children. Recursively traverse it and and you can get all the MonoBehaviors on each one and print their types, etc. Reading it all out is trivial, reconstructing it all again not so much.

1 Like

Yes, you are right. I have already implemented this, but I’m trying to find a way to do this in a released app instead of integrating those code to source code.

Everything I suggested above uses functions in the UnityEngine namespace so it will work fine in a released app.

Am I misunderstanding what you are asking?

1 Like

My target is to get inner information(such as hierarchy, text, rect of GameObjects) of an Unity app without having to deal with its source code.

I will say it again: Refer to my post above. You can do ALL of this. Start here:

Really… it can be done… it’s like less than an hour of coding, even when you have to learn the concept of using GetComponent.

I don’t think the OP is looking for this. It sounds like he is talking about hacking someone else’s game to get this information.

The answer is there is no built in way to take someone else’s released game and without access to the source code to be able to iterate through the hierarchy. I would assume it is possible if you developed your own system for examining the game’s memory footprint, and figuring out how to identify everything you’re looking for in memory. But if you had the skills needed to pull that off, you wouldn’t be asking the question here anyways. So the answer is no.

1 Like

Oh Uncle Joe, I think you nailed it. I didn’t notice that ‘original game project’ wording.

Good luck OP! Check the modding forums. There are definitely a lot of tools out there for hacking and modding Unity games. This forum is for people using Unity as a product.

2 Likes