Godot Version
4.2.1 MONO
Question
I have exported property Value. Property type is Variant.Type.Object
When I expand list of variants with possible values I see all possible values for this type.
But I want to customize this list with my values. How can I do it?
qza2468
December 26, 2023, 5:34am
2
I couldn’t even create a export value with type Object
, how do you do this?
@export var ccc: Object = Object.new()
error is “Export: type can only be built-in, a resource, a node, or an enum.”
Gustjc
December 26, 2023, 6:02am
3
You just need to set the export variable to your own custom class type.
For example an Effect class
@export var value: Effect
Then you extend that custom type and it’ll show all available types
Base class
extends Resource
class_name Effect
func execute_effect():
pass
And a custom type BurnEffect
extends Effect
class_name Burn
func execute_effect():
print("Burn")
It should be resource, node or enum
Value has dynamic type. It setup from _GetPropertiesList. It can extend MyClass or OtherClass. I want to change possible objects list and add to this list only types that extends used custom class.