private void PutLabelsOn(List <Vector2Int> positions, string[] labelcontents, string defaultContent = "?") { for (int i = 0; i < positions.Count; i++) { CellLabel newLabel = Instantiate <CellLabel>(labelPrefab); newLabel.SetContent((i < labelcontents.Length ? labelcontents[i] : defaultContent).ToString()); newLabel.SetColor(labelColor2); PutLabelOn(positions[i], newLabel); } }
public void SetStartEndLabels() { CellLabel startLabel = Instantiate <CellLabel>(labelPrefab); startLabel.SetContent("A"); startLabel.SetColor(labelColor1); PutLabelOn(startCell, startLabel); CellLabel endLabel = Instantiate <CellLabel>(labelPrefab); endLabel.SetContent("B"); endLabel.SetColor(labelColor1); PutLabelOn(endCell, endLabel); }
private void PutLabelsOn(List <Vector2Int> positions, char content, bool increment = false) { if (positions == null) { return; } for (int i = 0; i < positions.Count; i++) { CellLabel newLabel = Instantiate <CellLabel>(labelPrefab); newLabel.SetContent(((char)(content + (increment ? i : 0))).ToString()); newLabel.SetColor(labelColor2); PutLabelOn(positions[i], newLabel); } }
private void PutLabelsOn(List <Vector2Int> positions, int startInt) { if (positions == null) { return; } for (int i = 0; i < positions.Count; i++) { CellLabel newLabel = Instantiate <CellLabel>(labelPrefab); newLabel.SetContent(((startInt + i)).ToString()); newLabel.SetColor(labelColor2); PutLabelOn(positions[i], newLabel); } }