Table of Contents

Class SceneState

Namespace
Godot
Assembly
GodotSharp.dll

Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts associated with a scene. They cannot be modified from a SceneState, only accessed. Useful for peeking into what a PackedScene contains without instantiating it.

This class cannot be instantiated directly, it is retrieved for a given scene as the result of GetState().

public class SceneState : RefCounted, IDisposable
Inheritance
SceneState
Implements
Inherited Members

Methods

GetConnectionBinds(int)

Returns the list of bound parameters for the signal at idx.

public Array GetConnectionBinds(int idx)

Parameters

idx int

Returns

Array

GetConnectionCount()

Returns the number of signal connections in the scene.

The idx argument used to query connection metadata in other get_connection_* methods in the interval [0, get_connection_count() - 1].

public int GetConnectionCount()

Returns

int

GetConnectionFlags(int)

Returns the connection flags for the signal at idx. See GodotObject.ConnectFlags constants.

public int GetConnectionFlags(int idx)

Parameters

idx int

Returns

int

GetConnectionMethod(int)

Returns the method connected to the signal at idx.

public StringName GetConnectionMethod(int idx)

Parameters

idx int

Returns

StringName

GetConnectionSignal(int)

Returns the name of the signal at idx.

public StringName GetConnectionSignal(int idx)

Parameters

idx int

Returns

StringName

GetConnectionSource(int)

Returns the path to the node that owns the signal at idx, relative to the root node.

public NodePath GetConnectionSource(int idx)

Parameters

idx int

Returns

NodePath

GetConnectionTarget(int)

Returns the path to the node that owns the method connected to the signal at idx, relative to the root node.

public NodePath GetConnectionTarget(int idx)

Parameters

idx int

Returns

NodePath

GetConnectionUnbinds(int)

Returns the number of unbound parameters for the signal at idx.

public int GetConnectionUnbinds(int idx)

Parameters

idx int

Returns

int

GetNodeCount()

Returns the number of nodes in the scene.

The idx argument used to query node data in other get_node_* methods in the interval [0, get_node_count() - 1].

public int GetNodeCount()

Returns

int

GetNodeGroups(int)

Returns the list of group names associated with the node at idx.

public string[] GetNodeGroups(int idx)

Parameters

idx int

Returns

string[]

GetNodeIndex(int)

Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the idx argument used here and in other methods.

public int GetNodeIndex(int idx)

Parameters

idx int

Returns

int

GetNodeInstance(int)

Returns a PackedScene for the node at idx (i.e. the whole branch starting at this node, with its child nodes and resources), or null if the node is not an instance.

public PackedScene GetNodeInstance(int idx)

Parameters

idx int

Returns

PackedScene

GetNodeInstancePlaceholder(int)

Returns the path to the represented scene file if the node at idx is an InstancePlaceholder.

public string GetNodeInstancePlaceholder(int idx)

Parameters

idx int

Returns

string

GetNodeName(int)

Returns the name of the node at idx.

public StringName GetNodeName(int idx)

Parameters

idx int

Returns

StringName

GetNodeOwnerPath(int)

Returns the path to the owner of the node at idx, relative to the root node.

public NodePath GetNodeOwnerPath(int idx)

Parameters

idx int

Returns

NodePath

GetNodePath(int, bool)

Returns the path to the node at idx.

If forParent is true, returns the path of the idx node's parent instead.

public NodePath GetNodePath(int idx, bool forParent = false)

Parameters

idx int
forParent bool

Returns

NodePath

GetNodePropertyCount(int)

Returns the number of exported or overridden properties for the node at idx.

The prop_idx argument used to query node property data in other get_node_property_* methods in the interval [0, get_node_property_count() - 1].

public int GetNodePropertyCount(int idx)

Parameters

idx int

Returns

int

GetNodePropertyName(int, int)

Returns the name of the property at propIdx for the node at idx.

public StringName GetNodePropertyName(int idx, int propIdx)

Parameters

idx int
propIdx int

Returns

StringName

GetNodePropertyValue(int, int)

Returns the value of the property at propIdx for the node at idx.

public Variant GetNodePropertyValue(int idx, int propIdx)

Parameters

idx int
propIdx int

Returns

Variant

GetNodeType(int)

Returns the type of the node at idx.

public StringName GetNodeType(int idx)

Parameters

idx int

Returns

StringName

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

IsNodeInstancePlaceholder(int)

Returns true if the node at idx is an InstancePlaceholder.

public bool IsNodeInstancePlaceholder(int idx)

Parameters

idx int

Returns

bool