Skip to content

Commit

Permalink
Fix RayCast2D support
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelpicosean committed Jul 22, 2021
1 parent d7d02ac commit 0c8e5d3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/scene/2d/ray_cast_2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export class RayCast2D extends Node2D {
if (data.cast_to !== undefined) {
this.cast_to.copy(data.cast_to);
}
if (data.collide_with_ares !== undefined) {
this.collide_with_areas = data.collide_with_ares;
if (data.collide_with_areas !== undefined) {
this.collide_with_areas = data.collide_with_areas;
}
if (data.collide_with_bodies !== undefined) {
this.collide_with_bodies = data.collide_with_bodies;
Expand Down
22 changes: 22 additions & 0 deletions tool/converter/res/RayCast2D.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const {
int,
boolean,
} = require('../../parser/type_converters');

const Node2D = require('./Node2D');

module.exports = (data) => {
const res = Object.assign({}, Node2D(data), {
type: 'RayCast2D',
cast_to: data.prop.cast_to,
collide_with_areas: boolean(data.prop.collide_with_areas),
collide_with_bodies: boolean(data.prop.collide_with_bodies),
collision_mask: int(data.prop.collision_mask),
enabled: boolean(data.prop.enabled),
exclude_parent: boolean(data.prop.exclude_parent),
});

return res;
};

module.exports.is_tres = true;

0 comments on commit 0c8e5d3

Please sign in to comment.