本文整理汇总了C#中GameManager.getWaypoints方法的典型用法代码示例。如果您正苦于以下问题:C# GameManager.getWaypoints方法的具体用法?C# GameManager.getWaypoints怎么用?C# GameManager.getWaypoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameManager
的用法示例。
在下文中一共展示了GameManager.getWaypoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TileMapData
// tile map
public TileMapData(int x_size, int y_size)
{
this.size_x = x_size;
this.size_y = y_size;
map_tiles = new DTile[size_x, size_y];
// gameManager Stuff
go = GameObject.Find("GameManager(Clone)");
gameManagerScript = go.GetComponent<GameManager>();
// Debug.Log("ITs not null");
// Construct Data map with Tiles from XML
// Example without XML
for (int x = 0; x < size_x; x++)
{
for (int y = 0; y < size_y; y++)
{
map_tiles[x, y] = new DBuildTile(x, y);
}
}
if (gameManagerScript.getWaypoints() != null) {
List<Vector2> wayPointsList = gameManagerScript.getWaypoints();
// add path to tile
// Debug.Log("Starting Pathing");
int mini;
int maxi;
for (int i = 0; i < wayPointsList.Count - 1; i++)
{
Vector2 current = wayPointsList[i];
Vector2 next = wayPointsList[i + 1];
// vertical
if (current.x == next.x)
{
// loop from start to next mark path tile
int x = (int)current.x;
mini = Mathf.Min((int)current.y, (int)next.y);
maxi = Mathf.Max((int)current.y, (int)next.y);
for (int y = mini; y < maxi + 1; y++)
{
map_tiles[x, y] = new DWalkableTile(x, y);
}
}
// horizontal
else {
int y = (int)current.y;
mini = Mathf.Min((int)current.x, (int)next.x);
maxi = Mathf.Max((int)current.x, (int)next.x);
// loop from start to next mark
for (int x = mini; x < maxi + 1; x++)
{
map_tiles[x, y] = new DWalkableTile(x, y);
}
}
}
}
}