34 lines
599 B
C#
34 lines
599 B
C#
|
using Godot;
|
||
|
public enum TileTypes
|
||
|
{
|
||
|
NONE,
|
||
|
Grass,
|
||
|
Sand,
|
||
|
Water,
|
||
|
}
|
||
|
|
||
|
public partial class building_block : Node3D
|
||
|
{
|
||
|
[Export]
|
||
|
public RayCast3D _ray = null;
|
||
|
|
||
|
[Export]
|
||
|
private TileTypes _compatible_tile = TileTypes.NONE;
|
||
|
|
||
|
public bool IsPlaceable
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
if (_ray == null || _compatible_tile == TileTypes.NONE)
|
||
|
return false;
|
||
|
|
||
|
GodotObject collider = _ray.GetCollider();
|
||
|
GD.Print(collider);
|
||
|
|
||
|
if (collider == null)
|
||
|
return false;
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|