// TODO" fix interp public override void OnMove(Vector2Int newPos) { // FIXME: use real tile size Vector2 goal = MapManagerReference.WorldPosFromGridIndex(newPos) + new Vector2(.5f, .5f); float maxDist = MovementSpeed / 2; if (maxDist < 2.5f) { maxDist = 2.5f; } if (Vector2.Distance(transform.position, goal) > maxDist) // Crappy interp { transform.position = goal; } else { Move(goal); } }
public override void OnUpdate() { transform.position = MapManagerReference.WorldPosFromGridIndex(tilePos) + new Vector2(.5f, .5f); }