Пример #1
0
 public GameplayTrackingData StartTracking()
 {
     _gameplayTrackingData = new GameplayTrackingData();
     SetupTrackingData();
     AddEventListeners();
     return _gameplayTrackingData;
 }
Пример #2
0
    public void Init(GameplayTrackingData gameplayTrackingData)
    {
        _baseNumberOfKeepPlaying = GameplaySettings.Instance.NumberOfKeepPlaying;

        _gameplayTrackingData = gameplayTrackingData;
        GameplayEventsDispatcher.Instance.OnOutOfLives += OnOutOfLivesHandler;
        GameplayEventsDispatcher.Instance.OnTimeUp += OnTimeUpHandler;
    }
Пример #3
0
 public void DisplayGameOverData(GameplayTrackingData gameplayTrackingData)
 {
     _gameplayTrackingData = gameplayTrackingData;
     _scoreLabel.text = _gameplayTrackingData.Score.ToString();
     GameplayTrackingData highScore = HighScoreManager.Instance.GetHighScore(_gameplayTrackingData.GameplayMode);
     if (highScore != null)
     {
         _bestScoreLabel.text = "Best: " + highScore.Score;
     }
     else
     {
         _bestScoreLabel.gameObject.SetActive(false);
     }
     _currencyGainLabel.text = _gameplayTrackingData.CollectedCurrency.ToString() + "Coins";
 }
Пример #4
0
    public void Init(int startingLives, GameplayTrackingData gameplayTrackingData)
    {
        _isActive = true;
        _gameplayTrackingData = gameplayTrackingData;
        GameplayEventsDispatcher.Instance.OnChromieDropped += OnChromieDroppedHandler;
        GameplayEventsDispatcher.Instance.OnGameOver += OnGameOverHandler;
        GameplayEventsDispatcher.Instance.OnKeepPlaying += OnKeepPlayingHandler;
        _startingLives = startingLives;
        _maxLives = _startingLives;
        _currentLives = _startingLives;

        GameplayEventsDispatcher.SendLiveUpdate(_maxLives, _currentLives, 0);

        _hitIndicatorPrefab = Resources.Load("HitIndicator") as GameObject;
        if (_hitIndicatorPrefab == null)
        {
            Debug.LogError("ERROR - Hit Indicator could not be found in resources!");
        }
    }
Пример #5
0
    // Use this for initialization
    IEnumerator Start()
    {
        #if UNITY_EDITOR
        GameSetupManager.Instance.Init();
        #endif
        Physics2D.gravity = new Vector2(0, -9.81f * GameplaySettings.Instance.GameSpeedMultiplier);

        _gameplayTrackingData = this.gameObject.AddComponent<GameplayTrackingManager>().StartTracking();

        yield return 0f;
        Timing.RunCoroutine(PrepareGame());
    }