diff --git a/world/voxel_chunk_prop_data.cpp b/world/voxel_chunk_prop_data.cpp index 2b2598d..eb7b519 100644 --- a/world/voxel_chunk_prop_data.cpp +++ b/world/voxel_chunk_prop_data.cpp @@ -56,6 +56,13 @@ void VoxelChunkPropData::set_mesh(const Ref value) { _mesh = value; } +Ref VoxelChunkPropData::get_mesh_texture() const { + return _texture; +} +void VoxelChunkPropData::set_mesh_texture(const Ref value) { + _texture = value; +} + Ref VoxelChunkPropData::get_light() const { return _light; } @@ -86,6 +93,7 @@ VoxelChunkPropData::VoxelChunkPropData() { } VoxelChunkPropData::~VoxelChunkPropData() { _mesh.unref(); + _texture.unref(); _light.unref(); _prop.unref(); _scene.unref(); @@ -124,6 +132,10 @@ void VoxelChunkPropData::_bind_methods() { ClassDB::bind_method(D_METHOD("set_mesh", "value"), &VoxelChunkPropData::set_mesh); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "MeshDataResource"), "set_mesh", "get_mesh"); + ClassDB::bind_method(D_METHOD("get_mesh_texture"), &VoxelChunkPropData::get_mesh_texture); + ClassDB::bind_method(D_METHOD("set_mesh_texture", "value"), &VoxelChunkPropData::set_mesh_texture); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_mesh_texture", "get_mesh_texture"); + ClassDB::bind_method(D_METHOD("get_light"), &VoxelChunkPropData::get_light); ClassDB::bind_method(D_METHOD("set_light", "value"), &VoxelChunkPropData::set_light); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanPropLight"), "set_light", "get_light"); diff --git a/world/voxel_chunk_prop_data.h b/world/voxel_chunk_prop_data.h index 0f0d1ff..1f694b2 100644 --- a/world/voxel_chunk_prop_data.h +++ b/world/voxel_chunk_prop_data.h @@ -4,6 +4,7 @@ #include "core/reference.h" #include "core/math/vector3.h" +#include "scene/resources/texture.h" #include "scene/resources/packed_scene.h" #include "../props/voxelman_prop.h" #include "../props/voxelman_prop_light.h" @@ -37,6 +38,9 @@ public: Ref get_mesh() const; void set_mesh(const Ref value); + Ref get_mesh_texture() const; + void set_mesh_texture(const Ref value); + Ref get_light() const; void set_light(const Ref value); @@ -63,6 +67,7 @@ private: Vector3 _snap_axis; Ref _mesh; + Ref _texture; Ref _light; Ref _prop; Ref _scene;