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; }
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; }
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); }
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; } }
public TowerSimpleData(TowerSimpleData data) { TowerType = data.TowerType; TowerSize = data.TowerSize; Cost = data.Cost; }
public TowerSimpleData(E_TowerType type, E_TileSize size, int cost) { TowerType = type; TowerSize = size; Cost = cost; }