basic building structures
This commit is contained in:
34
buildings/building_block.cs
Normal file
34
buildings/building_block.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user