示例#1
0
 protected override void OnPopulateMesh(VertexHelper vh)
 {
     vh.Clear();
     UIMeshGenerationHelper.AddLine(vh, _startWorld, _endWorld - _startWorld, _style.Width,
                                    _colors.GetForState(_state).Value,
                                    UIMeshGenerationHelper.CapsType.Round);
 }
示例#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;
    }