示例#1
0
 public void UpdateUI(Vector3 originWorld, Vector3 directionWorld,
                      CoordinateUIStyle.GridLineStyle lambdaStyleGridLineStyle, bool isVisible)
 {
     _originScreen    = WorldScreenTransformationHelper.WorldToScreenPoint(originWorld);
     _directionScreen = WorldScreenTransformationHelper.WorldToScreenPoint(directionWorld);
     _style           = lambdaStyleGridLineStyle;
     _isVisible       = isVisible;
     SetVerticesDirty();
 }
示例#2
0
    public void UpdateUI(string labelString, Vector3 labelPositionWorld,
                         CoordinateUIStyle.LabelStyle style, CoordinateUIStyle.ColorSet colors, SketchStyle.State state)
    {
        _label.text     = labelString;
        _label.color    = colors.GetForState(state).Value;
        _label.fontSize = style.FontSize;

        var anchoredPosition =
            WorldScreenTransformationHelper.WorldToUISpace(GetComponentInParent <Canvas>(), labelPositionWorld);

        GetComponent <RectTransform>().anchoredPosition = anchoredPosition;
    }
示例#3
0
        protected override void OnPopulateMesh(VertexHelper vh)
        {
            vh.Clear();
            var p = WorldScreenTransformationHelper.WorldToScreenPoint(_positionWorld);

            void DrawLine(Vector2 direction)
            {
                var o = p + direction * _innerRadius;
                var v = direction * _radius;

                UIMeshGenerationHelper.AddLine(vh, o, v, _width, _color, UIMeshGenerationHelper.CapsType.None);
            }

            DrawLine(Vector2.up + Vector2.right);
            DrawLine(Vector2.up + Vector2.left);
            DrawLine(Vector2.down + Vector2.right);
            DrawLine(Vector2.down + Vector2.left);
        }