SceneState
Provides access to a scene file’s information.
SceneState.swift:14class SceneState
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
.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
func getConnectionBinds(idx: Int32
) -> GArray Returns the list of bound parameters for the signal at
idx
.func getConnectionCount(
) -> Int32 Returns the number of signal connections in the scene.
func getConnectionFlags(idx: Int32
) -> Int32 Returns the connection flags for the signal at
idx
. SeeObject.ConnectFlags
constants.func getConnectionMethod(idx: Int32
) -> StringName Returns the method connected to the signal at
idx
.func getConnectionSignal(idx: Int32
) -> StringName Returns the name of the signal at
idx
.func getConnectionSource(idx: Int32
) -> NodePath Returns the path to the node that owns the signal at
idx
, relative to the root node.func getConnectionTarget(idx: Int32
) -> NodePath Returns the path to the node that owns the method connected to the signal at
idx
, relative to the root node.func getConnectionUnbinds(idx: Int32
) -> Int32 Returns the number of unbound parameters for the signal at
idx
.func getNodeCount(
) -> Int32 Returns the number of nodes in the scene.
func getNodeGroups(idx: Int32
) -> PackedStringArray Returns the list of group names associated with the node at
idx
.func getNodeIndex(idx: Int32
) -> Int32 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.func getNodeInstance(idx: Int32
) -> PackedScene? Returns a
PackedScene
for the node atidx
(i.e. the whole branch starting at this node, with its child nodes and resources), ornull
if the node is not an instance.func getNodeInstancePlaceholder(idx: Int32
) -> String Returns the path to the represented scene file if the node at
idx
is anInstancePlaceholder
.func getNodeName(idx: Int32
) -> StringName Returns the name of the node at
idx
.func getNodeOwnerPath(idx: Int32
) -> NodePath Returns the path to the owner of the node at
idx
, relative to the root node.func getNodePath(idx: Int32, forParent: Bool
) -> NodePath Returns the path to the node at
idx
.func getNodePropertyCount(idx: Int32
) -> Int32 Returns the number of exported or overridden properties for the node at
idx
.func getNodePropertyName(idx: Int32, propIdx: Int32
) -> StringName Returns the name of the property at
propIdx
for the node atidx
.func getNodePropertyValue(idx: Int32, propIdx: Int32
) -> Variant Returns the value of the property at
propIdx
for the node atidx
.func getNodeType(idx: Int32
) -> StringName Returns the type of the node at
idx
.func isNodeInstancePlaceholder(idx: Int32
) -> Bool Returns
true
if the node atidx
is anInstancePlaceholder
.