diff --git a/prop_instance.cpp b/prop_instance.cpp index d0a43df..6ca1e73 100644 --- a/prop_instance.cpp +++ b/prop_instance.cpp @@ -209,6 +209,21 @@ void PropInstance::_init_materials() { } void PropInstance::build() { + call("_build"); +} + +void PropInstance::queue_build() { +} + +void PropInstance::build_finished() { + _building = false; + + if (_build_queued) { + call_deferred("build"); + } +} + +void PropInstance::_build() { _building = true; _build_queued = false; @@ -237,17 +252,6 @@ void PropInstance::build() { prop_preprocess(Transform(), _prop_data); } -void PropInstance::queue_build() { -} - -void PropInstance::build_finished() { - _building = false; - - if (_build_queued) { - call_deferred("build"); - } -} - void PropInstance::_build_finished() { } @@ -442,7 +446,9 @@ void PropInstance::_bind_methods() { ClassDB::bind_method(D_METHOD("queue_build"), &PropInstance::queue_build); ClassDB::bind_method(D_METHOD("build_finished"), &PropInstance::build_finished); + BIND_VMETHOD(MethodInfo("_build")); BIND_VMETHOD(MethodInfo("_build_finished")); + ClassDB::bind_method(D_METHOD("_build"), &PropInstance::_build); ClassDB::bind_method(D_METHOD("_build_finished"), &PropInstance::_build_finished); } diff --git a/prop_instance.h b/prop_instance.h index fe273c0..5d778d8 100644 --- a/prop_instance.h +++ b/prop_instance.h @@ -98,6 +98,8 @@ public: void build(); void queue_build(); void build_finished(); + + virtual void _build(); virtual void _build_finished(); void prop_preprocess(Transform tarnsform, const Ref &prop);