コード例 #1
0
    private HexCell MakeCell(int x, int z, int i, Vector3 pos)
    {
        HexCell _cell = Instantiate <HexCell>(HexCellPref);

        _cells[i] = _cell;
        _cell.transform.SetParent(transform);
        _cell.transform.localPosition = pos;
        _cell.CellColor = DefaultColor;
        _cell.HexCoord  = HexCoord.FromOffsetCoord(x, z);
        _cell.name      = "cell" + _cell.HexCoord.X + "," + _cell.HexCoord.Z;
        _cell.Elevation = Random.Range(1, 5);
        return(_cell);
    }