示例#1
0
    void TouchCell(Vector3 position)
    {
        position = transform.InverseTransformPoint(position);
        HexagonCoord coordinates = HexagonCoord.FromPosition(position);
        int          index       = coordinates.X_coord + coordinates.Z_coord * width + coordinates.Z_coord / 2;

        Debug.Log(index);
        HexagonCell cell = cells[index];

        cell.color = touchedColor;
        hexMesh.Triangulate(cells);
    }
示例#2
0
 void Start()
 {
     hexagonMesh.Triangulate(cells);
 }