sabresaurus/Sidekick

Target any System.Object

Closed this issue · 0 comments

Right now Sidekick is partially built on Unity's instance ID system. This means that a remote build communicates instance IDs to the editor which Sidekick can then address. For example if the build says that there's a Transform component with instance ID 27, you could then supply a new value for the position property on instance ID 27 and it would update that specific Transform. Unfortunately instance IDs only exist for UnityEngine.Objects which is rather limiting.

To support being able to address any object the remote build should be able to track any object by using our own instance ID/GUID system matched against a System.Object. This would mean that you could drill down further into Components and follow reference chains to wonderful places far from Unity components.

Care must be taken that the map doesn't get too big and that proper UnityEngine.Object null checking remains. If I remember correctly ((object)aComponent) == null doesn't work with the Unity null check override, so casting would be required.