DynamicGodotObject Class |
Namespace: Godot
public class DynamicGodotObject : DynamicObject
The DynamicGodotObject type exposes the following members.
Name | Description | |
---|---|---|
![]() | DynamicGodotObject |
Initializes a new instance of the DynamicGodotObject class.
|
Name | Description | |
---|---|---|
![]() | GetDynamicMemberNames | |
![]() | TryBinaryOperation | |
![]() | TryConvert | |
![]() | TryGetIndex | |
![]() | TryGetMember | |
![]() | TryInvokeMember | |
![]() | TrySetIndex | |
![]() | TrySetMember |
The DynamicGodotObject class enables access to the Variant members of a Object instance at runtime.
This allows accessing the class members using their original names in the engine as well as the members from the script attached to the Object, regardless of the scripting language it was written in.
dynamic sprite = GetNode("Sprite").DynamicGodotObject; sprite.add_child(this); if ((sprite.hframes * sprite.vframes) > 0) sprite.frame = 0;
dynamic childNode = GetNode("ChildNode").DynamicGodotObject; if (childNode.print_allowed) { childNode.message = "Hello from C#"; childNode.print_message(3); }
// # ChildNode.gd // var print_allowed = true // var message = "" // // func print_message(times): // for i in times: // print(message)