void Start()
    {
        mapGenerator.GenerateMap(70, 60, seed);
        cellCount = 70 * 60;

        HexMapCamera.CenterPosition();

        if (isServer)
        {
            GetAvailableCells();

            do
            {
                FindTreasureCell();
            } while (!FindStartCell(40, 20));

            itemTypes.Add((int)HexItemType.Treasure);
            itemCellIndex.Add(treasureCell.Index);

            RemoveAvailableCell(serverStart);
            RemoveAvailableCell(clientStart);
            RemoveAvailableCell(treasureCell);

            SpreadKeys(10);
            SpreadItems(100);

            SendStart();
        }

        inGame = true;
    }
Beispiel #2
0
    public HexGrid InitMap()
    {
        grid.Init(mapX, mapY);
        mapGenerator.GenerateMap(mapX, mapY);

        Shader.DisableKeyword("HEX_MAP_EDIT_MODE");
        //Shader.EnableKeyword("HEX_MAP_EDIT_MODE");
        terrainMaterial.DisableKeyword("GRID_ON");

        return(grid);
    }
Beispiel #3
0
 void CreateMap(int x, int z)
 {
     if (generateMaps)
     {
         mapGenerator.GenerateMap(x, z);
     }
     else
     {
         hexGrid.CreateMap(x, z);
     }
     HexMapCamera.ValidatePosition();
     Close();
 }
Beispiel #4
0
 /// <summary>
 /// 创建地图
 /// </summary>
 /// <param name="x"></param>
 /// <param name="z"></param>
 void CreateMap(int x, int z)
 {
     if (generateMaps)
     {
         mapGenerator.GenerateMap(x, z); // 生成随机地图
     }
     else
     {
         hexGrid.CreateMap(x, z);        // 生成默认地图
     }
     HexMapCamera.ValidatePosition();    // 验证地图边界,矫正摄像机位置
     Close();
 }
Beispiel #5
0
 void CreateMap(int x, int z)
 {
     //проверка способа создания карты
     if (generateMaps)
     {
         mapGenerator.GenerateMap(x, z, wrapping);
     }
     else
     {
         hexGrid.CreateMap(x, z, wrapping);
     }
     HexMapCamera.ValidatePosition();
     Close();
 }
        void CreateMap(int x, int z)
        {
            if (GenerateMaps.Value)
            {
                _hexMapGenerator.GenerateMap(x, z);
            }
            else
            {
                _hexMapEditor.hexGrid.CreateMap(x, z);
            }
            //HexMapCamera.ValidatePosition();

            ContentViewSwitcher.SwitchTo("MainRegion");
        }
 void CreateMap(int x, int z)
 {
     if (generateMaps)
     {
         mapGenerator.GenerateMap(x, z);
     }
     else
     {
         hexGrid.CreateMap(x, z);
     }
     HexMapCamera.ValidatePosition();
     playMode.RespawnPlayInRandomCell();
     Close();
 }
    public void CreateMap(int x, int z)
    {
        if (m_generateMaps)
        {
            HexMapGenerator.GenerateMap(x, z, m_wrap);
        }
        else
        {
            HexGrid.CreateMap(x, z, m_wrap);
        }

        HexMapCamera.ValidatePosition();
        Close();
    }
Beispiel #9
0
    //TODO: sprawdzić, czy da się wykonać kolorowanie i nadawanie koordynatów jednocześnie
    private IEnumerator ManageTiles(HexMapGenerator mapGenerator)
    {
        yield return(null);

        yield return(mapGenerator.GenerateMap());

        hexTileList = mapGenerator.TileList;

        ColorTiles();
        GenerateSystemElements();

        var hexagonalCoordinateController = new HexagonalCoordinateController(hexTileList.First());

        hexagonalCoordinateController.ApplyCoordinates();

        yield return(new WaitForEndOfFrame());

        onMapGeneratedEvent.Invoke();
    }
Beispiel #10
0
    void CreateMap(int x, int z)
    {
        if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_countMax.text))
        {
            UIManager.Instance.SystemTips("地图名或最大玩家数不能是空的!", PanelSystemTips.MessageType.Error);
            return;
        }
        if (generateMaps)
        {
            mapGenerator.GenerateMap(x, z, wrapping);
        }
        else
        {
            hexGrid.CreateMap(x, z, wrapping);
        }

        Save();
        //HexMapCamera.ValidatePosition();
        Close();
    }
 void Awake()
 {
     mapGenerator.GenerateMap();
 }