mirror of
https://github.com/Relintai/voxelman.git
synced 2025-01-25 15:09:18 +01:00
Added a "_prop_added" vmethod to Chunk.
This commit is contained in:
parent
fd3a162126
commit
472b077d3f
@ -429,6 +429,9 @@ void VoxelChunk::clear_baked_lights() {
|
|||||||
|
|
||||||
void VoxelChunk::add_prop(Ref<VoxelChunkPropData> prop) {
|
void VoxelChunk::add_prop(Ref<VoxelChunkPropData> prop) {
|
||||||
_props.push_back(prop);
|
_props.push_back(prop);
|
||||||
|
|
||||||
|
if (has_method("_prop_added"))
|
||||||
|
call("_prop_added", prop);
|
||||||
}
|
}
|
||||||
Ref<VoxelChunkPropData> VoxelChunk::get_prop(int index) {
|
Ref<VoxelChunkPropData> VoxelChunk::get_prop(int index) {
|
||||||
return _props.get(index);
|
return _props.get(index);
|
||||||
@ -731,6 +734,8 @@ void VoxelChunk::_bind_methods() {
|
|||||||
BIND_VMETHOD(MethodInfo("_create_mesh"));
|
BIND_VMETHOD(MethodInfo("_create_mesh"));
|
||||||
BIND_VMETHOD(MethodInfo("_create_mesher"));
|
BIND_VMETHOD(MethodInfo("_create_mesher"));
|
||||||
|
|
||||||
|
BIND_VMETHOD(MethodInfo("_prop_added", PropertyInfo(Variant::OBJECT, "prop", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunkPropData")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("_create_mesher"), &VoxelChunk::_create_mesher);
|
ClassDB::bind_method(D_METHOD("_create_mesher"), &VoxelChunk::_create_mesher);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_chunk_position_x"), &VoxelChunk::get_chunk_position_x);
|
ClassDB::bind_method(D_METHOD("get_chunk_position_x"), &VoxelChunk::get_chunk_position_x);
|
||||||
|
Loading…
Reference in New Issue
Block a user