当前位置: 首页>>代码示例>>C#>>正文


C# VectorLine.SetupVertexColors方法代码示例

本文整理汇总了C#中VectorLine.SetupVertexColors方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.SetupVertexColors方法的具体用法?C# VectorLine.SetupVertexColors怎么用?C# VectorLine.SetupVertexColors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VectorLine的用法示例。


在下文中一共展示了VectorLine.SetupVertexColors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetColor

 public static void SetColor(VectorLine line, Color color)
 {
     if (line.lineColors == null) {
         line.SetupVertexColors();
     }
     int end = line.lineColors.Length;
     for (int i = 0; i < end; i++) {
         line.lineColors[i] = color;
     }
     line.mesh.colors = line.lineColors;
 }
开发者ID:ericjxl2013,项目名称:MDIEdit,代码行数:11,代码来源:Vector.cs

示例2: SetColors

    public static void SetColors(VectorLine line, Color[] lineColors)
    {
        if (line.lineColors == null) {
            line.SetupVertexColors();
        }
        if (!line.isPoints) {
            if (WrongArrayLength (line, lineColors.Length, FunctionName.SetColors)) {
                return;
            }
        }
        else if (lineColors.Length != GetPointsLength(line)) {
            LogError("Vector: SetColors: Length of lineColors array in " + line.vectorObject.name + " must be same length as points array");
            return;
        }

        int start = 0;
        int end = lineColors.Length;
        SetStartAndEnd (line, ref start, ref end);
        int idx = start*4;

        for (int i = start; i < end; i++) {
            line.lineColors[idx]   = lineColors[i];
            line.lineColors[idx+1] = lineColors[i];
            line.lineColors[idx+2] = lineColors[i];
            line.lineColors[idx+3] = lineColors[i];
            idx += 4;
        }
        line.mesh.colors = line.lineColors;
    }
开发者ID:ericjxl2013,项目名称:MDIEdit,代码行数:29,代码来源:Vector.cs

示例3: SetColorsSmooth

    public static void SetColorsSmooth(VectorLine line, Color[] lineColors)
    {
        if (line.isPoints) {
            LogError ("Vector: SetColorsSmooth must be used with a line rather than points");
            return;
        }
        if (line.lineColors == null) {
            line.SetupVertexColors();
        }
        if (WrongArrayLength (line, lineColors.Length, FunctionName.SetColorsSmooth)) {
            return;
        }

        int start = 0;
        int end = lineColors.Length;
        SetStartAndEnd (line, ref start, ref end);
        int idx = start*4;

        line.lineColors[idx  ] = lineColors[start];
        line.lineColors[idx+1] = lineColors[start];
        line.lineColors[idx+2] = lineColors[start];
        line.lineColors[idx+3] = lineColors[start];
        idx += 4;
        for (int i = start+1; i < end; i++) {
            line.lineColors[idx  ] = lineColors[i-1];
            line.lineColors[idx+1] = lineColors[i-1];
            line.lineColors[idx+2] = lineColors[i];
            line.lineColors[idx+3] = lineColors[i];
            idx += 4;
        }
        line.mesh.colors = line.lineColors;
    }
开发者ID:dayglo,项目名称:StormTest,代码行数:32,代码来源:Vector.cs


注:本文中的VectorLine.SetupVertexColors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。