Bit more reorder.

This commit is contained in:
Relintai 2022-08-29 19:51:17 +02:00
parent 3894452760
commit 00c25ed930
2 changed files with 25 additions and 26 deletions

View File

@ -36,16 +36,6 @@ void World::set_world_2d(const Ref<World2D> &p_world_2d) {
_on_set_world_2d(old_world);
}
Ref<World2D> World::find_world_2d() const {
if (world_2d.is_valid()) {
return world_2d;
} else if (_parent_world) {
return _parent_world->find_world_2d();
} else {
return Ref<World2D>();
}
}
Ref<World3D> World::get_world_3d() const {
return world_3d;
}
@ -83,18 +73,6 @@ void World::set_world_3d(const Ref<World3D> &p_world_3d) {
_on_set_world_3d(old_world);
}
Ref<World3D> World::find_world_3d() const {
if (own_world_3d.is_valid()) {
return own_world_3d;
} else if (world_3d.is_valid()) {
return world_3d;
} else if (_parent_world) {
return _parent_world->find_world_3d();
} else {
return Ref<World3D>();
}
}
bool World::is_using_own_world_3d() const {
return own_world_3d.is_valid();
}
@ -129,6 +107,28 @@ void World::set_use_own_world_3d(bool p_use_own_world_3d) {
_on_set_use_own_world_3d(p_use_own_world_3d);
}
Ref<World2D> World::find_world_2d() const {
if (world_2d.is_valid()) {
return world_2d;
} else if (_parent_world) {
return _parent_world->find_world_2d();
} else {
return Ref<World2D>();
}
}
Ref<World3D> World::find_world_3d() const {
if (own_world_3d.is_valid()) {
return own_world_3d;
} else if (world_3d.is_valid()) {
return world_3d;
} else if (_parent_world) {
return _parent_world->find_world_3d();
} else {
return Ref<World3D>();
}
}
World::World() {
world_2d = Ref<World2D>(memnew(World2D));
}

View File

@ -15,16 +15,15 @@ public:
Ref<World2D> get_world_2d() const;
void set_world_2d(const Ref<World2D> &p_world_2d);
Ref<World2D> find_world_2d() const;
Ref<World3D> get_world_3d() const;
void set_world_3d(const Ref<World3D> &p_world);
Ref<World3D> find_world_3d() const;
void set_use_own_world_3d(bool p_use_own_world_3d);
bool is_using_own_world_3d() const;
Ref<World2D> find_world_2d() const;
Ref<World3D> find_world_3d() const;
World();
~World();