// TODO: make this smarter private void OnAxialInput(float h, float v) { if (_cameraMover.Moving) { return; } Rect roomBounds = _mapEntity.GetBoundsForCoord(GameManager.Instance.CurrentCoord); XY delta = null; if (h < 0) { delta = new XY((int)-roomBounds.width, 0); } else if (h > 0) { delta = new XY((int)roomBounds.width, 0); } else if (v < 0) { delta = new XY(0, -(int)roomBounds.height); } else if (v > 0) { delta = new XY(0, (int)roomBounds.height); } if (delta != null) { _cameraMover.Move(delta); } }
private void OnPlayerMove(Vector3 position, Vector3 velocity) { Rect roomBounds = _mapEntity.GetBoundsForCoord(GameManager.Instance.CurrentCoord); if (position.x < roomBounds.xMin) { _camMover.Move(new XY((int)-roomBounds.width, 0)); } else if (position.x > roomBounds.xMax) { _camMover.Move(new XY((int)roomBounds.width, 0)); } else if (position.z < roomBounds.yMin) { _camMover.Move(new XY(0, -(int)roomBounds.height)); } else if (position.z > roomBounds.yMax) { _camMover.Move(new XY(0, (int)roomBounds.height)); } }