-
Notifications
You must be signed in to change notification settings - Fork 2
/
Tile.cs
48 lines (43 loc) · 1.15 KB
/
Tile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
namespace Nitemare3D
{
public enum TileState
{
solid,
opening,
closing
}
public class Tile
{
public int textureID = -1;
public bool obstacle = true;
public bool thin = false;
public bool door = false;
public byte x,y;
public bool flip = false;
float openAmount = 0;
public TileState state = TileState.solid;
public WallType type;
public void UpdateDoorState()
{
switch (state)
{
case TileState.solid:
break;
case TileState.opening:
openAmount += Time.dt;
if(openAmount > 1)
{
openAmount = 1;
state = TileState.solid;
}
break;
case TileState.closing:
break;
}
}
public virtual void OnUse(){}
public virtual void Create(){}
public virtual void OnShoot(){}
public virtual void Update(){}
}
}