本文整理汇总了C#中VectorLine.SetWidths方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.SetWidths方法的具体用法?C# VectorLine.SetWidths怎么用?C# VectorLine.SetWidths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorLine
的用法示例。
在下文中一共展示了VectorLine.SetWidths方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: removeFrontNode
public void removeFrontNode()
{
color_list.RemoveAt(0);
width_list.RemoveAt(0);
Vector3[] new_points = new Vector3[path_line.points3.Length -1];
for(int i = 0; i < new_points.Length - 1; ++i)
{
new_points[i] = path_line.points3[i+1];
}
VectorLine.Destroy(ref path_line);
path_line = new VectorLine("path", new_points, null, 5F ,LineType.Continuous,Joins.Weld);
path_line.SetColorsSmooth(color_list.ToArray());
path_line.SetWidths(width_list.ToArray());
path_line.Draw3DAuto();
VectorLine del_spot = spot_list[0];
spot_list.RemoveAt(0);
VectorLine.Destroy(ref del_spot);
}
示例2: getPathLine
public static PathDisplay getPathLine(Path path)
{
Debug.Log("drawPath numba J");
// Debug.Log("awkward length " + path.getPathLength());
float usable_ap = mech.current_ap;
float max_ap = mech.max_ap;
if(path != null)
{
Vector3[] path_spots = new Vector3[path.getPathLength()];
Color[] path_colors = new Color[path_spots.Length-1];
float[] path_widths = new float[path_spots.Length-1];
int i = 0;
int this_turns_travelable = -1;
List<VectorLine> spots = new List<VectorLine>();
foreach(HexData path_pos in path.getTraverseOrderList())
{
// path_spots[i] = Camera.mainCamera.WorldToScreenPoint((hexManagerS.CoordsGameTo3D(path_pos.x, path_pos.z)));
path_spots[i] = ((hexManagerS.CoordsGameTo3D(path_pos.x, path_pos.z) + y_adj_line));
if(i != 0)
{
path_colors[i-1] = getColorFromCost(path_pos.traversal_cost);
usable_ap-=path_pos.traversal_cost;
if(usable_ap >= 0)
{
path_widths[i-1] = usable_ap/max_ap * max_path_width/2 + max_path_width/2;
}
else
{
usable_ap = 1;
if(this_turns_travelable == -1)
this_turns_travelable = i-1;
path_widths[i-1] = 2;
path_colors[i-1] = enginePlayerS.disable_color;
// break;
}
// var circle = new VectorLine("Circle", new Vector3[30], path_colors[i-1], null, 10F, LineType.Continuous, Joins.Weld);
// circle.MakeCircle(path_spots[i], Vector3.up, .3F);
// spots.Add(circle);
VectorLine outline = outlineHex(path_pos);
outline.SetColor(path_colors[i-1]);
outline.lineWidth = usable_ap/max_ap * max_path_width/2 + max_path_width/4;
spots.Add (outline);
}
Debug.Log(path_spots[i] + " | " + path_pos.traversal_cost);
i++;
}
Array.Resize(ref path_spots, i+1);
Array.Resize(ref path_colors, i);
Array.Resize(ref path_widths, i);
// for(int vc = 0; vc < lineColors.Length; ++vc)
// lineColors[vc] = Color.red;
//// lineColors[vc] = new Color(UnityEngine.Random.Range(0,255), UnityEngine.Random.Range(0,255), UnityEngine.Random.Range(0,255));
// VectorLine.SetLine (Color.green, path_spots);
// VectorLine.Destroy(ref player_route);
player_route = new VectorLine("Line", path_spots, path_colors, null, 5F, LineType.Continuous, Joins.Weld);
// player_route.MakeCircle(path_spots[3], Vector3.up, 2F, 10);
player_route.SetColorsSmooth(path_colors);
player_route.SetWidths(path_widths);
player_route.MakeSpline(path_spots);
player_route.smoothWidth = true;
// if(this_turns_travelable != -1)
// {
// var circle = new VectorLine("Circle", new Vector3[30], null, 10F, LineType.Continuous, Joins.Weld);
// circle.MakeCircle(path_spots[this_turns_travelable], Vector3.up, .3F);
//
// }
//
// VectorLine rings = new VectorLine("Ring1", new Vector2[8], Color.white, null, 10F, LineType.Continuous);
//
// rings.MakeCircle(path_spots[3], Vector3.up, 8F);
// rings.Draw3DAuto();
return new PathDisplay(spots, player_route, new List<Color>(path_colors), new List<float>(path_widths));
// player_route.Draw3DAuto();
}
return null;
}