Ejemplo n.º 1
0
        public override IEnumerator Initialization()
        {
            _currentScoreText.text = Model.CurrentScore.ToString("n0");
            _highScoreText.text    = Model.HighScore.ToString("n0");

            _transitionManager = ManagerProvider.Get <SceneTransitionManager>();
            yield return(new WaitForSeconds(3));

            _init = true;
        }
        public override void Initialize()
        {
            base.Initialize();
            _previousTimeScale = Time.timeScale;

            // Request the providers required
            _dataPersistance   = ManagerProvider.Get <DataPersistenceManager>();
            _transitionManager = ManagerProvider.Get <SceneTransitionManager>();
            _spawnerManager    = ManagerProvider.Get <SpawnerManager>();

            HighScore = _dataPersistance.PlayerData.CurrentHighScore;
        }
        public override IEnumerator Initialization()
        {
            _spawnerManager = ManagerProvider.Get <SpawnerManager>();
            _gameManager    = ManagerProvider.Get <GameManager>();

            _spawnerManager.CreateEnemyPools();
            _gameManager.SetupLevel(3);

            // Instantiate player ship
            AsyncOperationHandle <GameObject> handle = _playerReference.InstantiateAsync(_playerHolder, false);

            handle.Completed += OnPlayerInstantiatedCallback;

            _waveSequence.Initialize();

            yield return(new WaitForEndOfFrame());

            GenericEvent.Trigger(GenericEventType.LevelStarted, null);
        }
    IEnumerator Start()
    {
        // Set the frame rate to have virtual no limit
        Application.targetFrameRate = 300;

        // Find the service provider
        provider = FindObjectOfType <ManagerProvider>();
        if (provider == null)
        {
            throw new System.Exception("Manager provider wasn't found in the initialization scene");
        }

        // initialize the service provider
        provider.Init();

        // Allow stabilization so we wait a second here
        yield return(new WaitForSeconds(1));

        var transitionManager    = ManagerProvider.Get <SceneTransitionManager>();
        GameplaySceneModel model = new GameplaySceneModel();

        // Transition to the gameplay scene
        transitionManager.LoadScene(SceneIndex.GameplayScene, model);
    }
 public override void Initialize()
 {
     base.Initialize();
     _spawnerManager = ManagerProvider.Get <SpawnerManager>();
 }
 private void OnEnable()
 {
     _spawnerManager = ManagerProvider.Get <SpawnerManager>();
     _spawnerManager.RegisterSpawner(this);
 }
Ejemplo n.º 7
0
 public virtual void Initialize()
 {
     _character = GetComponent <Character>();
     _health    = GetComponent <Health>();
     _input     = ManagerProvider.Get <InputManager>();
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     _spawnerManager = ManagerProvider.Get <SpawnerManager>();
 }
Ejemplo n.º 9
0
 private void Awake()
 {
     _gameManager        = ManagerProvider.Get <GameManager>();
     _highScoreText.text = _gameManager.HighScore.ToString("n0");
 }