forked from LibraStack/Match3-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GridTile.cs
37 lines (31 loc) · 805 Bytes
/
GridTile.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
using Common.Interfaces;
using UnityEngine;
namespace Common.GridTiles
{
public abstract class GridTile : MonoBehaviour, IGridTile
{
private bool _isDestroyed;
public abstract int GroupId { get; }
public abstract bool IsLocked { get; }
public abstract bool CanContainItem { get; }
public void SetActive(bool value)
{
gameObject.SetActive(value);
}
public void SetWorldPosition(Vector3 worldPosition)
{
transform.position = worldPosition;
}
private void OnDestroy()
{
_isDestroyed = true;
}
public void Dispose()
{
if (_isDestroyed == false)
{
Destroy(gameObject);
}
}
}
}