InteractiveScapeGmbH / TuioUnityClient

MIT License
21 stars 2 forks source link

Is there a way to reference _tuioObject from Tuio11Behaviour? #10

Open mroglic opened 4 months ago

mroglic commented 4 months ago

Hi @eqbic, is there a particular reason _tuioObject is private and not public in Tuio11ObjectTransform? If we have Dictionary<uint, Tuio11Behaviour> as in Tuio11Visualizer it might be neat to also have access to corresponding objects/cursors/blobs directly from Tuio11Behaviour. Or there is a better way to do so?

Thanks!

eqbic commented 4 months ago

The Tuio11Visualizer is just a simple example how one could manage the tuio entities. In general you have multiple ways to access the cursors, object and blobs. All you need is the Tuio11Dispatcher. You can register for the OnObjectAdd event for example. there you get the new Tuio11Object and can store it however you want. Or you can call the GetTuioObjects() on the Tuio11Dispatcher to get a list of all objects.

The reason why I made the field private was that I think it should not be necessary to "talk" to the transform component after creation. It is only responsible for updating the transform of the UI element it is attached to. The information about the underlying tuio object is handled in a "manager-class" (like the Visualizer).

mroglic commented 4 months ago

Thanks for the explanation!