2023-06-10 17:14:55 -04:00
|
|
|
using Godot;
|
2023-06-11 12:54:09 -04:00
|
|
|
|
2023-06-10 17:14:55 -04:00
|
|
|
|
|
|
|
public partial class building_block : Node3D
|
|
|
|
{
|
|
|
|
[Export]
|
2023-06-11 12:54:09 -04:00
|
|
|
private RayCast3D _ground_ray;
|
2023-06-10 17:14:55 -04:00
|
|
|
[Export]
|
2023-06-11 12:54:09 -04:00
|
|
|
private RayCast3D _collision_ray;
|
2023-06-10 17:14:55 -04:00
|
|
|
|
|
|
|
public bool IsPlaceable
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2023-06-11 12:54:09 -04:00
|
|
|
return _collision_ray.GetCollider() == null && _ground_ray.GetCollider() != null && _ground_ray.GetCollider().GetType() == typeof(GridMap);
|
2023-06-10 17:14:55 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|