SPIRAL BY CHRISTIAN

This commit is contained in:
Simon Holmberg
2012-10-29 02:49:26 +00:00
parent 236d6c2859
commit 600661b911
2 changed files with 607 additions and 533 deletions
File diff suppressed because it is too large Load Diff
+33 -23
View File
@@ -113,30 +113,40 @@ namespace DepthsBelow
List<Point> soldierCollisions = new List<Point>();
// Collision with units at a standstill
foreach (var soldier in Squad)
{
if (soldier != this && !soldier.GetComponent<PathFinder>().IsMoving)
{
soldierCollisions.Add(soldier.Transform.Grid);
}
}
//foreach (var soldier in Squad)
//{
// if (soldier != this)
// {
// if (!soldier.GetComponent<PathFinder>().IsMoving)
// {
// soldierCollisions.Add(soldier.Transform.Grid);
// }
// if (soldier.Transform.Grid == nextNode.Position)
// {
// GetComponent<PathFinder>().RecreatePath(soldierCollisions);
// nextNode = GetComponent<PathFinder>().Next();
// break;
// }
// }
// Collision with moving units
foreach (var soldier in Squad)
{
if (soldier != this)
{
var pathFinder = soldier.GetComponent<PathFinder>();
var position = nextNode.Position;
if (soldier.Transform.Grid == position)
{
soldierCollisions.Add(soldier.Transform.Grid);
GetComponent<PathFinder>().RecreatePath(soldierCollisions);
nextNode = GetComponent<PathFinder>().Next();
break;
}
}
}
//}
// Collision with moving units
//foreach (var soldier in Squad)
//{
// if (soldier != this)
// {
// var pathFinder = soldier.GetComponent<PathFinder>();
// var position = nextNode.Position;
// if (soldier.Transform.Grid == position)
// {
// soldierCollisions.Add(soldier.Transform.Grid);
// GetComponent<PathFinder>().RecreatePath(soldierCollisions);
// nextNode = GetComponent<PathFinder>().Next();
// break;
// }
// }
//}
if (nextNode != null)
{