Renamed the world position property to just position in PropLight.

This commit is contained in:
Relintai 2021-08-11 18:18:03 +02:00
parent a5ab7ca180
commit 00536c9596
2 changed files with 10 additions and 10 deletions

View File

@ -22,11 +22,11 @@ SOFTWARE.
#include "prop_light.h" #include "prop_light.h"
Vector3 PropLight::get_world_position() { Vector3 PropLight::get_position() {
return _world_position; return _position;
} }
void PropLight::set_world_position(const Vector3 &pos) { void PropLight::set_position(const Vector3 &pos) {
_world_position = pos; _position = pos;
} }
Color PropLight::get_color() const { Color PropLight::get_color() const {
@ -51,9 +51,9 @@ PropLight::~PropLight() {
} }
void PropLight::_bind_methods() { void PropLight::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_world_position"), &PropLight::get_world_position); ClassDB::bind_method(D_METHOD("get_position"), &PropLight::get_position);
ClassDB::bind_method(D_METHOD("set_world_position"), &PropLight::set_color); ClassDB::bind_method(D_METHOD("set_position"), &PropLight::set_position);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "world_position"), "set_world_position", "get_world_position"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "world_position"), "set_position", "get_position");
ClassDB::bind_method(D_METHOD("get_color"), &PropLight::get_color); ClassDB::bind_method(D_METHOD("get_color"), &PropLight::get_color);
ClassDB::bind_method(D_METHOD("set_color"), &PropLight::set_color); ClassDB::bind_method(D_METHOD("set_color"), &PropLight::set_color);

View File

@ -39,8 +39,8 @@ class PropLight : public Reference {
GDCLASS(PropLight, Reference); GDCLASS(PropLight, Reference);
public: public:
Vector3 get_world_position(); Vector3 get_position();
void set_world_position(const Vector3 &pos); void set_position(const Vector3 &pos);
Color get_color() const; Color get_color() const;
void set_color(const Color &color); void set_color(const Color &color);
@ -55,7 +55,7 @@ private:
static void _bind_methods(); static void _bind_methods();
private: private:
Vector3 _world_position; Vector3 _position;
Color _color; Color _color;
int _size; int _size;