blob: 865cbbd0b5dd06b4881aec7780664ba0a73f589f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
using Godot;
using System;
public partial class Tile : Sprite2D
{
private TileDefinition definition;
public bool IsWalkable { get; private set; }
public Tile(Vector2I pos, TileDefinition definition)
{
Centered = false;
Position = Grid.GridToWorld(pos);
SetDefinition(definition);
}
public void SetDefinition(TileDefinition definition) {
this.definition = definition;
Texture = definition.Texture;
IsWalkable = definition.IsWalkable;
}
}
|