Beispiel #1
0
        private void _InstantiateHexagon(Vector3Int coords)
        {
            Vector3 worldSpacePos = HexMath.HexCoordsToWorldSpace(coords);

            GameObject HexagonGO = Instantiate(HexagonPrefab, worldSpacePos, Quaternion.identity, gameObject.transform);

            HexagonGO.name = "Hex " + coords.ToString();

            Hexagon hexagon = HexagonGO.AddComponent <Hexagon>();

            hexagon.Initialise(coords, 1);

            HexDict.Add(coords, hexagon);
        }