Given any GUI Control in the GUI hierarchy (the “this”) I would like to retrieve the AdvancedDynamicTexture “that” this GUI Control belongs to according to the inspector (see the red arrow in the drawing):
I seem to be able to traverse the Controls tree upwards using the parent field of Control until I reach the ‘root’. But the rootContainer of an AdvancedDynamicTexture doesn’t seem to have a field that points back to the AdvancedDynamicTexture it is a member of, right? (So that is my feature request.)
A temporary work around for me is to get all the textures in the scene, then traverse each AdvancedDynamicTexture in the scene on the rootContainer to find “this” GUI Control as a child. Though that would be poor performance as it has to traverse down many trees and child nodes.
Or to add a line of code after creation of the texture to manually set a new custom e.g. ‘_advancedDynamicTexture’ property of the rootContainer and point that to the AdvancedDynamicTexture. (That would probably be a possible technical solution for the feature request to do inside the CreateFullscreenUI function.)
I am using multiple AdvancedDynamicTextures in my app in order to support split-screen local multiplayer with custom viewports and layermasks.