//Displays danger zone for a given unit public void GenerateMaskPurple(Unit pUnit) { unit = pUnit; //Based on Mask Green List <Vector3Int> maskGreen = GenerateMaskGreen_MaxTurns(); maskGreen.Add(unit.GetPos()); List <Vector3Int> maskPurple = new List <Vector3Int>(); List <Vector3Int> attackPositions = unit.GetAttackPositions(); foreach (Vector3Int v in maskGreen) { foreach (Vector3Int ap in attackPositions) { Vector3Int pos = v + ap; TileBase tile = tileManager.baseMap.GetTile(pos); if (!maskPurple.Contains(pos) && tileManager.baseMap.GetTile(pos) != null) { if (!TileManager.ArrayContainsTile(tile, toIgnorePurple)) { maskPurple.Add(pos); } } } } ApplyMask(maskPurple, tileManager.purpleMask, tileManager.purpleMaskMap); }