Fix bugs.
parent
b791f0f5d2
commit
85b64b455f
|
@ -196,6 +196,7 @@ public class Unit : MonoBehaviour
|
|||
else
|
||||
{
|
||||
// Can't move to cell this is standed by enemy.
|
||||
destinationCell = standingCell;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +274,7 @@ public class Unit : MonoBehaviour
|
|||
|
||||
for (int i = 0; i < unitsInRange.Count; i++)
|
||||
{
|
||||
Debug.Log(unitsInRange[i].unitName + ": " + unitsInRange[i].standingCell.xPos + " , " + unitsInRange[i].standingCell.yPos);
|
||||
//Debug.Log(unitsInRange[i].unitName + ": " + unitsInRange[i].standingCell.xPos + " , " + unitsInRange[i].standingCell.yPos);
|
||||
// Do attack
|
||||
//Debug.Log("Attack!");
|
||||
unitsInRange[i].currentDefense -= finalAttack;
|
||||
|
|
|
@ -55,7 +55,10 @@ public class UnitManager : MonoBehaviour
|
|||
{
|
||||
unit.MoveAction();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var unit in rightSideUnits)
|
||||
{
|
||||
if (unit.isUnitAlive())
|
||||
{
|
||||
unit.AttackAction();
|
||||
|
@ -71,7 +74,10 @@ public class UnitManager : MonoBehaviour
|
|||
{
|
||||
unit.MoveAction();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var unit in leftSideUnits)
|
||||
{
|
||||
if (unit.isUnitAlive())
|
||||
{
|
||||
unit.AttackAction();
|
||||
|
@ -87,10 +93,10 @@ public class UnitManager : MonoBehaviour
|
|||
switch (side)
|
||||
{
|
||||
case Side.left:
|
||||
leftSideUnits = leftSideUnits.OrderByDescending(x => x.standingCell.xPos).ThenByDescending(y => y.standingCell.yPos).ToList<Unit>();
|
||||
leftSideUnits = leftSideUnits.OrderByDescending(x => x.standingCell.xPos).ThenBy(y => y.standingCell.yPos).ToList<Unit>();
|
||||
break;
|
||||
case Side.right:
|
||||
rightSideUnits = rightSideUnits.OrderBy(x => x.standingCell.xPos).ThenBy(y => y.standingCell.yPos).ToList<Unit>();
|
||||
rightSideUnits = rightSideUnits.OrderBy(x => x.standingCell.xPos).ThenByDescending(y => y.standingCell.yPos).ToList<Unit>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue