Class ClassDB
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Provides access to metadata stored for every available class.
public static class ClassDB
- Inheritance
-
ClassDB
- Inherited Members
Properties
Singleton
public static ClassDBInstance Singleton { get; }
Property Value
Methods
CanInstantiate(StringName)
public static bool CanInstantiate(StringName @class)
Parameters
classStringName
Returns
ClassExists(StringName)
Returns whether the specified class is available or not.
public static bool ClassExists(StringName @class)
Parameters
classStringName
Returns
ClassGetEnumConstants(StringName, StringName, bool)
Returns an array with all the keys in enum of class or its ancestry.
public static string[] ClassGetEnumConstants(StringName @class, StringName @enum, bool noInheritance = false)
Parameters
classStringNameenumStringNamenoInheritancebool
Returns
- string[]
ClassGetEnumList(StringName, bool)
Returns an array with all the enums of class or its ancestry.
public static string[] ClassGetEnumList(StringName @class, bool noInheritance = false)
Parameters
classStringNamenoInheritancebool
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 static long ClassGetIntegerConstant(StringName @class, StringName name)
Parameters
classStringNamenameStringName
Returns
ClassGetIntegerConstantEnum(StringName, StringName, bool)
Returns which enum the integer constant name of class or its ancestry belongs to.
public static StringName ClassGetIntegerConstantEnum(StringName @class, StringName name, bool noInheritance = false)
Parameters
classStringNamenameStringNamenoInheritancebool
Returns
ClassGetIntegerConstantList(StringName, bool)
Returns an array with the names all the integer constants of class or its ancestry.
public static string[] ClassGetIntegerConstantList(StringName @class, bool noInheritance = false)
Parameters
classStringNamenoInheritancebool
Returns
- string[]
ClassGetMethodArgumentCount(StringName, StringName, bool)
Returns the number of arguments of the method method of class or its ancestry if noInheritance is false.
public static int ClassGetMethodArgumentCount(StringName @class, StringName method, bool noInheritance = false)
Parameters
classStringNamemethodStringNamenoInheritancebool
Returns
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 static Array<Dictionary> ClassGetMethodList(StringName @class, bool noInheritance = false)
Parameters
classStringNamenoInheritancebool
Returns
ClassGetProperty(GodotObject, StringName)
Returns the value of property of object or its ancestry.
public static Variant ClassGetProperty(GodotObject @object, StringName property)
Parameters
objectGodotObjectpropertyStringName
Returns
ClassGetPropertyDefaultValue(StringName, StringName)
Returns the default value of property of class or its ancestor classes.
public static Variant ClassGetPropertyDefaultValue(StringName @class, StringName property)
Parameters
classStringNamepropertyStringName
Returns
ClassGetPropertyList(StringName, bool)
Returns an array with all the properties of class or its ancestry if noInheritance is false.
public static Array<Dictionary> ClassGetPropertyList(StringName @class, bool noInheritance = false)
Parameters
classStringNamenoInheritancebool
Returns
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 static Dictionary ClassGetSignal(StringName @class, StringName signal)
Parameters
classStringNamesignalStringName
Returns
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 static Array<Dictionary> ClassGetSignalList(StringName @class, bool noInheritance = false)
Parameters
classStringNamenoInheritancebool
Returns
ClassHasEnum(StringName, StringName, bool)
Returns whether class or its ancestry has an enum called name or not.
public static bool ClassHasEnum(StringName @class, StringName name, bool noInheritance = false)
Parameters
classStringNamenameStringNamenoInheritancebool
Returns
ClassHasIntegerConstant(StringName, StringName)
Returns whether class or its ancestry has an integer constant called name or not.
public static bool ClassHasIntegerConstant(StringName @class, StringName name)
Parameters
classStringNamenameStringName
Returns
ClassHasMethod(StringName, StringName, bool)
Returns whether class (or its ancestry if noInheritance is false) has a method called method or not.
public static bool ClassHasMethod(StringName @class, StringName method, bool noInheritance = false)
Parameters
classStringNamemethodStringNamenoInheritancebool
Returns
ClassHasSignal(StringName, StringName)
Returns whether class or its ancestry has a signal called signal or not.
public static bool ClassHasSignal(StringName @class, StringName signal)
Parameters
classStringNamesignalStringName
Returns
ClassSetProperty(GodotObject, StringName, Variant)
Sets property value of object to value.
public static Error ClassSetProperty(GodotObject @object, StringName property, Variant value)
Parameters
objectGodotObjectpropertyStringNamevalueVariant
Returns
GetClassList()
Returns the names of all the classes available.
public static string[] GetClassList()
Returns
- string[]
GetInheritersFromClass(StringName)
Returns the names of all the classes that directly or indirectly inherit from class.
public static string[] GetInheritersFromClass(StringName @class)
Parameters
classStringName
Returns
- string[]
GetParentClass(StringName)
Returns the parent class of class.
public static StringName GetParentClass(StringName @class)
Parameters
classStringName
Returns
Instantiate(StringName)
Creates an instance of class.
public static Variant Instantiate(StringName @class)
Parameters
classStringName
Returns
IsClassEnabled(StringName)
Returns whether this class is enabled or not.
public static bool IsClassEnabled(StringName @class)
Parameters
classStringName
Returns
IsClassEnumBitfield(StringName, StringName, bool)
Returns whether class (or its ancestor classes if noInheritance is false) has an enum called enum that is a bitfield.
public static bool IsClassEnumBitfield(StringName @class, StringName @enum, bool noInheritance = false)
Parameters
classStringNameenumStringNamenoInheritancebool
Returns
IsParentClass(StringName, StringName)
Returns whether inherits is an ancestor of class or not.
public static bool IsParentClass(StringName @class, StringName inherits)
Parameters
classStringNameinheritsStringName