Gui scenes are made up of nodes. Using gui api in gui scripts you can cache nodes then enable or disable them or return if they are enabled or not as needed.
gui.is_enabled(node) would return true or false
With your example when the main collection is loaded by default Scene1 and Scene2 will be enabled . Say you wanted to disable them at loading. Then if you have gui scripts for these scenes and for example in init function gui.set_enabled(node,disabled) then it would be disabled on initialization. The design of how you want to go about it is really up to your needs.
Example:
function init(self)
local node = gui.get_node("box") -- box being the id of the node you want to cache
print(gui.is_enabled(node)) -- printing to editor debug window node is enabled/disabled
end
Is it possible from Scene1 (from script attached to Scene1) to check if Scene2 is enabled or not (not node in Scene2 but whole Scene2 (game object with attached gui scene)?
Yes that is possible , you can use [ Message Passing ] between scripts and setup logic for that.
for Game objects in a collection scope(not in gui scene) you would use a normal script , setup logic to receive messages and pass messages between gui_script and script in your main collection. Could then hold state of gui’s enabled/disabled and pass a return message when needed.
If I may ask what exactly are you trying to do?
Note:
( For game objects(go’s) in collections you can use [ Game object API ] in scripts. For GUI collections you can use [ GUI API ] in gui_scripts. Then to communicate between scripts you can use [ Message passing ]. You can send a message from gui scene1 to scene2 or vice-versa and setup logic for handling your needs. )
What I usually do is to have a central screen manager script or module that keeps track of the state of the application and which scene that is currently visible. This makes it easy for your game logic to query the screen manager for the current state.