本文整理汇总了C#中Path.getTraverseOrderList方法的典型用法代码示例。如果您正苦于以下问题:C# Path.getTraverseOrderList方法的具体用法?C# Path.getTraverseOrderList怎么用?C# Path.getTraverseOrderList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path.getTraverseOrderList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: moveToHexViaPath
//
// void OnGUI()
// {
// Vector3 screen_pos = Camera.main.WorldToScreenPoint (transform.position);
// GUI.Label(new Rect(screen_pos.x - 100, Screen.height - screen_pos.y+30, 200, 15), current_hp + "/" + max_hp + " HP", enginePlayerS.hover_text);
// GUI.Label(new Rect(screen_pos.x - 100, Screen.height - screen_pos.y + 45, 200, 15), current_ap + "/" + max_ap + " AP", enginePlayerS.hover_text);
// }
public static void moveToHexViaPath(Path _travel_path)
{
travel_path = _travel_path.getTraverseOrderList();
travel_path_en = travel_path.GetEnumerator();
travel_path_en.MoveNext();
moving_on_path = true;
}
示例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;
}