コード例 #1
0
        public void Shoot()
        {
            if (_isCooldown || _isDead || _planetModel.GetAmmoByType(_currentRocketSettings.rocketType) <= 0)
            {
                return;
            }
            var rocket = _rocketFactory.Create();
            var state  = rocket.GetCurrentState();

            state.RocketType = _currentRocketSettings.rocketType;
            state.UpdateState(muzzleTransform.position, transform.rotation, ROCKET_START_VELOCITY);
            rocket.Configure(state);
            _planetModel.DecrementAmmoByType(_currentRocketSettings.rocketType);
            StartCoroutine(StartCooldown());
        }
コード例 #2
0
        public void LoadGame()
        {
            if (_playerPlanet != null)
            {
                DisposePools();
            }

            _localSaveController.LoadSaveFile(delegate(GameModel info)
            {
                gameModel = info;
                ApplyStates();
                foreach (var rocketState in gameModel.GetRocketModels())
                {
                    var rocket = _rocketFactory.Create();
                    rocket.Configure(rocketState);
                }

                ResumeGame();

                _aiSystem.RegisterEnemies(_enemies);
            }, Debug.LogError);
        }