Table of Contents

Class ClassDBInstance

Namespace
Godot
Assembly
GodotSharp.dll

Provides access to metadata stored for every available class.

[GodotClassName("ClassDB")]
public class ClassDBInstance : GodotObject, IDisposable
Inheritance
ClassDBInstance
Implements
Inherited Members

Methods

CanInstantiate(StringName)

Returns true if objects can be instantiated from the specified class, otherwise returns false.

public bool CanInstantiate(StringName @class)

Parameters

class StringName

Returns

bool

ClassExists(StringName)

Returns whether the specified class is available or not.

public bool ClassExists(StringName @class)

Parameters

class StringName

Returns

bool

ClassGetEnumConstants(StringName, StringName, bool)

Returns an array with all the keys in enum of class or its ancestry.

public string[] ClassGetEnumConstants(StringName @class, StringName @enum, bool noInheritance = false)

Parameters

class StringName
enum StringName
noInheritance bool

Returns

string[]

ClassGetEnumList(StringName, bool)

Returns an array with all the enums of class or its ancestry.

public string[] ClassGetEnumList(StringName @class, bool noInheritance = false)

Parameters

class StringName
noInheritance bool

Returns

string[]

ClassGetIntegerConstant(StringName, StringName)

Returns the value of the integer constant name of class or its ancestry. Always returns 0 when the constant could not be found.

public long ClassGetIntegerConstant(StringName @class, StringName name)

Parameters

class StringName
name StringName

Returns

long

ClassGetIntegerConstantEnum(StringName, StringName, bool)

Returns which enum the integer constant name of class or its ancestry belongs to.

public StringName ClassGetIntegerConstantEnum(StringName @class, StringName name, bool noInheritance = false)

Parameters

class StringName
name StringName
noInheritance bool

Returns

StringName

ClassGetIntegerConstantList(StringName, bool)

Returns an array with the names all the integer constants of class or its ancestry.

public string[] ClassGetIntegerConstantList(StringName @class, bool noInheritance = false)

Parameters

class StringName
noInheritance bool

Returns

string[]

ClassGetMethodList(StringName, bool)

Returns an array with all the methods of class or its ancestry if noInheritance is false. Every element of the array is a Dictionary with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage).

Note: In exported release builds the debug info is not available, so the returned dictionaries will contain only method names.

public Array<Dictionary> ClassGetMethodList(StringName @class, bool noInheritance = false)

Parameters

class StringName
noInheritance bool

Returns

Array<Dictionary>

ClassGetProperty(GodotObject, StringName)

Returns the value of property of object or its ancestry.

public Variant ClassGetProperty(GodotObject @object, StringName property)

Parameters

object GodotObject
property StringName

Returns

Variant

ClassGetPropertyList(StringName, bool)

Returns an array with all the properties of class or its ancestry if noInheritance is false.

public Array<Dictionary> ClassGetPropertyList(StringName @class, bool noInheritance = false)

Parameters

class StringName
noInheritance bool

Returns

Array<Dictionary>

ClassGetSignal(StringName, StringName)

Returns the signal data of class or its ancestry. The returned value is a Dictionary with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage).

public Dictionary ClassGetSignal(StringName @class, StringName signal)

Parameters

class StringName
signal StringName

Returns

Dictionary

ClassGetSignalList(StringName, bool)

Returns an array with all the signals of class or its ancestry if noInheritance is false. Every element of the array is a Dictionary as described in ClassGetSignal(StringName, StringName).

public Array<Dictionary> ClassGetSignalList(StringName @class, bool noInheritance = false)

Parameters

class StringName
noInheritance bool

Returns

Array<Dictionary>

ClassHasEnum(StringName, StringName, bool)

Returns whether class or its ancestry has an enum called name or not.

public bool ClassHasEnum(StringName @class, StringName name, bool noInheritance = false)

Parameters

class StringName
name StringName
noInheritance bool

Returns

bool

ClassHasIntegerConstant(StringName, StringName)

Returns whether class or its ancestry has an integer constant called name or not.

public bool ClassHasIntegerConstant(StringName @class, StringName name)

Parameters

class StringName
name StringName

Returns

bool

ClassHasMethod(StringName, StringName, bool)

Returns whether class (or its ancestry if noInheritance is false) has a method called method or not.

public bool ClassHasMethod(StringName @class, StringName method, bool noInheritance = false)

Parameters

class StringName
method StringName
noInheritance bool

Returns

bool

ClassHasSignal(StringName, StringName)

Returns whether class or its ancestry has a signal called signal or not.

public bool ClassHasSignal(StringName @class, StringName signal)

Parameters

class StringName
signal StringName

Returns

bool

ClassSetProperty(GodotObject, StringName, Variant)

Sets property value of object to value.

public Error ClassSetProperty(GodotObject @object, StringName property, Variant value)

Parameters

object GodotObject
property StringName
value Variant

Returns

Error

GetClassList()

Returns the names of all the classes available.

public string[] GetClassList()

Returns

string[]

GetInheritersFromClass(StringName)

Returns the names of all the classes that directly or indirectly inherit from class.

public string[] GetInheritersFromClass(StringName @class)

Parameters

class StringName

Returns

string[]

GetParentClass(StringName)

Returns the parent class of class.

public StringName GetParentClass(StringName @class)

Parameters

class StringName

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

Instantiate(StringName)

Creates an instance of class.

public Variant Instantiate(StringName @class)

Parameters

class StringName

Returns

Variant

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

IsClassEnabled(StringName)

Returns whether this class is enabled or not.

public bool IsClassEnabled(StringName @class)

Parameters

class StringName

Returns

bool

IsParentClass(StringName, StringName)

Returns whether inherits is an ancestor of class or not.

public bool IsParentClass(StringName @class, StringName inherits)

Parameters

class StringName
inherits StringName

Returns

bool