コード例 #1
0
        private void DrawEdge(IGUIState guiState, Control control, int index)
        {
            if (GetShapeType() == ShapeType.Polygon)
            {
                var nextIndex = NextIndex(index);
                var color     = Color.white;

                if (guiState.nearestControl == control.ID && control.layoutData.index == index && guiState.hotControl == 0)
                {
                    color = Color.yellow;
                }

                m_Drawer.DrawLine(GetPoint(index).position, GetPoint(nextIndex).position, 5f, color);
            }
            else if (GetShapeType() == ShapeType.Spline)
            {
                var nextIndex = NextIndex(index);
                var color     = Color.white;

                if (guiState.nearestControl == control.ID && control.layoutData.index == index && guiState.hotControl == 0)
                {
                    color = Color.yellow;
                }

                m_Drawer.DrawBezier(
                    GetPoint(index).position,
                    GetRightTangent(index),
                    GetLeftTangent(nextIndex),
                    GetPoint(nextIndex).position,
                    5f,
                    color);
            }
        }