Esempio n. 1
0
    private Vector3 ToWorldPosition(RoomPlanPoint point)
    {
        Vector2 viewportPosition = (point.transform as RectTransform).anchoredPosition;

        viewportPosition.x /= Screen.width;
        viewportPosition.y /= Screen.height;

        viewportPosition -= Vector2.one * 0.5f;

        float horizontalSize = (float)Screen.width / (float)Screen.height * _model.VerticalSize;

        Vector3 worldPosition = new Vector3(
            viewportPosition.x * horizontalSize,
            0,
            viewportPosition.y * _model.VerticalSize
            );

        return(worldPosition);
    }
Esempio n. 2
0
 private void UpdateLine(RoomPlanPoint planPoint)
 {
     _lineRenderer.enabled       = _model.Points.Count > 1;
     _lineRenderer.positionCount = _model.Points.Count;
     _lineRenderer.SetPosition(_model.Points.Count - 1, planPoint.transform.position + Vector3.forward);
 }