Пример #1
0
    private IEnumerator Init()
    {
        levelData = ScriptableObject.CreateInstance <LevelData>();

        var tilesPostitions = new List <Vector3>();

        for (int x = 0; x < 8; x++)
        {
            for (int y = 0; y < 12; y++)
            {
                tilesPostitions.Add(new Vector3(x, y));
            }
        }
        levelData.tiles = tilesPostitions;
        Board.Load(levelData);

        SpawnTestUnits();
        RoundController.StartGame();

        yield return(null);

        owner.ChangeState <SelectUnitState>();
    }
Пример #2
0
 // Start is called before the first frame update
 private void StartGame()
 {
     if (player != null)
     {
         player.StartGame();
     }
     if (uiController != null && player != null)
     {
         uiController.StartGame();
     }
     if (audioManager != null)
     {
         audioManager.StartGame();
     }
     if (slotsController != null)
     {
         slotsController.StartGame();
     }
     if (roundController != null)
     {
         roundController.StartGame();
     }
     isGameRunning = true;
 }