Пример #1
0
    private void Update()
    {
        float total = _simulator.RedCirclesCount + _simulator.BlueCirclesCount;
        float val   = total > 0 ? _simulator.RedCirclesCount / total : 0.5f;

        _mainUI.SetAdvantageSliderValue(val);
        if (_isGameComplete)
        {
            _mainUI.gameObject.SetActive(false);
            _view.gameObject.SetActive(false);
            ResultsPanel resultsPanel = _uiFactory.CreateResultsPanel();
            double       elapsedTime  = _simulator.SimulationRateInSeconds * _simulator.IterationsCount;
            resultsPanel.Setup(TimeSpan.FromSeconds(elapsedTime), _simulator.RedCirclesCount, _simulator.BlueCirclesCount, PlayAgainClickedHandler);
            _isGameComplete = false;
        }
    }
Пример #2
0
    /// <summary>
    /// Listener to load from the buttons the resultsPanel (details of a program)
    /// </summary>
    /// <param name="_datum"></param>
    public void onLoadProgramDetails(Datum _datum)
    {
        if (_datum != null)
        {
            resultsPanel.Setup(_datum);

            // Load a thumbnail if we have one
            if (_datum.image.available)
            {
                //Debug.Log("thumbnail available");
                thumbnailPanel.LoadThumbnail(_datum.image.id);
            }
        }
        else
        {
            Debug.Log("Datum is null!");
        }
    }
Пример #3
0
 void HandleOnEndOfGame(bool won, int baseScore, int deckScore, int timeScore, int totalScore, int coinsCollected, int deckCoins, int timeCoins, int totalCoins)
 {
     resultsPanel.Toggle(true);
     resultsPanel.Setup(won, baseScore, deckScore, timeScore, totalScore, coinsCollected, deckCoins, timeCoins, totalCoins);
 }