Beispiel #1
0
    private void Start()
    {
        _gameSettings = new GameSettings();

        _ballManager.Init(_gameSettings.BallCount, _playerManager, _postAllignment);
        _playerManager.Init(_ballManager, _gameSettings.InitialPlayerCount, _gameSettings.ColorList);
        _postAllignment.Init(_playerManager, _gameSettings.InitialPlayerCount, _gameSettings.CircleRange);
    }
    public void StartGame()
    {
        AdManager.Instance.ShowBanner();

        life    = DEFAULT_LIFE;
        level   = 1;
        percent = 0f;
        if (shape != null)
        {
            Destroy(shape.gameObject);
        }
        shape       = MakeShape(null, true);
        area        = shape.Area();
        destroyArea = 0;

        if (mode == 0)
        {
            ballManager.Init(1);
            ballManager.OnStart();
            slicerManager.Init(1);
            slicerManager.OnStart();
        }
        else if (mode == 1)
        {
            ballManager.Init(1);
            ballManager.OnStart();
            slicerManager.Init(3);
            slicerManager.OnStart();
        }
        else if (mode == 2)
        {
            ballManager.Init(1);
            ballManager.OnStart();
            slicerManager.Init(1);
            slicerManager.OnStart();
        }

        gamePlay.background.color = Palette.Translate(PColor.PURPLE);
        shape.FillColor(Palette.Translate(PColor.PURPLE));
    }
 /// <summary>
 /// Initialize the level manager and all the rest game objects that needs it
 /// </summary>
 void Awake()
 {
     Init();
     _sizeManager.Init(this);
     _deadZone.Init(this);
     _mapGenerator.Init(this);
     _boardManager.Init(this, _mapGenerator.CreateLevel(GameManager.instance.GetSelectedLevelName()));
     // _boardManager.Init(this, _mapGenerator.CreateLevel("mapdata" + "4"));
     _aimController.Init(this, _botCanvasSize, _topCanvasSize);
     _ballManager.Init(this, _ballsToSpawn);
     _canvasManager.Init(this);
     _powerUpManager.Init(this);
 }
Beispiel #4
0
    private IEnumerator ShowCanvas()
    {
        // Pause before showing the canvas
        yield return(new WaitForSeconds(PAUSE_BEFORE_CANVAS));

        // Enable and reset the UI elements
        canvas.enabled       = true;
        slider.enabled       = true;
        slider.value         = slider.minValue;
        submitButton.enabled = true;
        results.text         = "";

        BallManager.Init(); // Generate a random number of balls
    }