Пример #1
0
    public void RemoveUnit(GameUnit unit)
    {
        int index = unit.GetTileY() * mainGraph.Width + unit.GetTileX();

        mainGraph.nodes[index].Walkable = true;

        mainUnits.Remove(unit);

        switch (unit.unitType)
        {
        case UnitType.Character:
            GameCharacter character = (GameCharacter)unit;
            character.owningPlayer.RemoveCharacter(character);
            mainCharacters.Remove(unit);
            break;
        }

        unit.currTile.currUnit = null;
        Destroy(unit.gameObject);
    }