2018-09-27 00:38:49 +02:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class TilePosition : GenericPosition
|
|
|
|
|
{
|
|
|
|
|
public override MapPosition Position
|
|
|
|
|
{
|
2018-09-30 16:35:17 +02:00
|
|
|
|
get { return position; }
|
2018-09-27 00:38:49 +02:00
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2018-09-30 16:35:17 +02:00
|
|
|
|
position = value;
|
2018-09-27 00:38:49 +02:00
|
|
|
|
if (Debug.isDebugBuild)
|
|
|
|
|
{
|
|
|
|
|
//Check if the tile is in the expected position
|
2018-09-30 16:35:17 +02:00
|
|
|
|
Vector3 expectedPosition = new Vector3(position.x, position.y);
|
2018-09-27 00:38:49 +02:00
|
|
|
|
if (transform.position != expectedPosition)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogWarningFormat("{0}'s TilePosition is mismatched with its transform position.", gameObject.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|