Search Unity

Question Any hidden event locations for object tracking?

Discussion in 'Editor & General Support' started by Digika, Sep 8, 2020.

  1. Digika

    Digika

    Joined:
    Jan 7, 2018
    Posts:
    225
    For very deep debug purposes at Runtime, I need to track EVERY.SINGLE.ONE UnityEngine.Object (GameObject) creation. Problem is, hooking up to internal Instantiate method will only get me results called from managed domain. I need every single one, even the ones that are instantiated when scene loaded.

    Unity is full of such hidden super-useful stuff that is never mentioned anywhere. Does anyone know if there is something I can expose? Will have to resort to patching the original player binary via Ghidra but I need to know what exactly to look for.
     
  2. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    161
    Why patching the original Player when you can create your very own from the sources we share as part of the Reflect package (available in Package Manager) and giving you access to object instantiation events ?
     
  3. Digika

    Digika

    Joined:
    Jan 7, 2018
    Posts:
    225
    I'm confused, what sources? Unity's C++ backend is closed.
     
  4. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    161
    Oh, maybe I'm mistaken. Is your question related to Reflect ?
     
  5. Digika

    Digika

    Joined:
    Jan 7, 2018
    Posts:
    225
    No, sorry, no idea what Reflect is. In short, Unity knows when objects are crated an destroyed (regardless in which way it is, resource/scene load or manual), I want to tap into that power to get that info (at Runtime) and do some personal tracking.
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Moving this to the general support area.