Example #1
0
    // Ready function, called once at the beginning of the scene when all children are ready
    public override void _Ready()
    {
        // Assign the buttons' container node
        sceneButtonsContainer = GetNode("SceneControlsPanel/SceneButtonsContainer");

        // When this node is ready, immediately disable the button for the currently selected scene
        // NOTE: THE currentScene VARIABLE IS USED AS THE INDEX THAT CORRESPONDS TO THE ORDER OF THE BUTTONS AS CHILDRENS OF THE HBOXCONTAINER
        sceneButtonsContainer.GetChild <Button>(GlobalControl.currentScene).Disabled = true;
    }
Example #2
0
 public static T GetChild <T>(this Godot.Node self, int idx) where T : Godot.Node
 {
     return(self.GetChild(idx) as T);
 }