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(); }
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); }