예제 #1
0
 public TowerBasicData(E_TowerType type, float hp, float atk, float speed, float range, float area, E_TileSize size)
 {
     Type  = type;
     Hp    = hp;
     Atk   = atk;
     Speed = speed;
     Range = range;
     Area  = area;
     Size  = size;
 }
예제 #2
0
 public TowerBasicData(TowerBasicData data)
 {
     Type  = data.Type;
     Hp    = data.Hp;
     Atk   = data.Atk;
     Speed = data.Speed;
     Range = data.Range;
     Area  = data.Area;
     Size  = data.Size;
 }
예제 #3
0
    public bool CanUpgrade(E_TileSize before, E_TileSize after, Tile.Position pos)
    {
        if (before == after)
        {
            return(true);
        }

        if (before == E_TileSize.Tile1 && after == E_TileSize.Tile4)
        {
            if (!tileDic[new Tile.Position(pos.x - 1, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y - 1)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y + 1)].Built)
            {
                return(true);
            }
        }
        else if (before == E_TileSize.Tile1 && after == E_TileSize.Tile9)
        {
            if (!tileDic[new Tile.Position(pos.x - 1, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y - 1)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y + 1)].Built &&
                !tileDic[new Tile.Position(pos.x - 2, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x + 2, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y - 2)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y + 2)].Built &&
                !tileDic[new Tile.Position(pos.x - 1, pos.y + 1)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y + 1)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y - 1)].Built &&
                !tileDic[new Tile.Position(pos.x - 1, pos.y - 1)].Built)
            {
                return(true);
            }
        }
        else if (before == E_TileSize.Tile4 && after == E_TileSize.Tile9)
        {
            if (!tileDic[new Tile.Position(pos.x - 2, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x + 2, pos.y)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y - 2)].Built &&
                !tileDic[new Tile.Position(pos.x, pos.y + 2)].Built &&
                !tileDic[new Tile.Position(pos.x - 1, pos.y + 1)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y + 1)].Built &&
                !tileDic[new Tile.Position(pos.x + 1, pos.y - 1)].Built &&
                !tileDic[new Tile.Position(pos.x - 1, pos.y - 1)].Built)
            {
                return(true);
            }
        }

        return(false);
    }
예제 #4
0
    public void OnClickTowerInfo(TowerSimpleData data)
    {
        InitHoveredTileList();

        tileSize = data.TowerSize;

        switch (tileSize)
        {
        case E_TileSize.Tile1:
        case E_TileSize.Tile9:
        {
            goNormalTiles.SetActive(true);
            goQuadTiles.SetActive(false);
        }
        break;

        case E_TileSize.Tile4:
        {
            goNormalTiles.SetActive(false);
            goQuadTiles.SetActive(true);
        }
        break;
        }
    }
예제 #5
0
 public TowerSimpleData(TowerSimpleData data)
 {
     TowerType = data.TowerType;
     TowerSize = data.TowerSize;
     Cost      = data.Cost;
 }
예제 #6
0
 public TowerSimpleData(E_TowerType type, E_TileSize size, int cost)
 {
     TowerType = type;
     TowerSize = size;
     Cost      = cost;
 }