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