Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (_shipCondition.IsSinking() && _fogOn)
     {
         _fogOn = false;
         ToggleFog(_fogOn);
     }
 }
Example #2
0
        void Update()
        {
            if (_ship.IsSinking())
            {
                return;
            }

            _moveTarget        = new Vector3(0, 0, _moveDistance);
            transform.position = Vector3.MoveTowards(transform.position,
                                                     new Vector3(0, transform.position.y, _moveTarget.z), _speed);
        }
Example #3
0
        public void Tick(ShipCondition ship)
        {
            if (ship.IsSinking())
            {
                return;
            }

            _time -= Time.deltaTime;
            _roundTimeUI.Value = (float)_time;
            if (_time <= 0)
            {
                _levelEventManager.SetLevelPlayState(LevelEventManager.LevelPlayState.Won);
                SceneManager.LoadScene("ScoreScene");
            }
        }
Example #4
0
        public void Tick()
        {
            if (_playerShip.IsSinking())
            {
                _IsPaused = true;
            }

            if (_IsPaused)
            {
                return;
            }

            UpdateAvailableHazards();

            if (_easyHazards.Count == 0 && _mediumHazards.Count == 0 && _hardHazards.Count == 0 &&
                _introduction.Count == 0)
            {
                Debug.LogError("No hazards");
                return;
            }

            // Force progressing in tutorial to avoid hard locking the game
            _tutorialTimer += Time.deltaTime;
            if (_tutorialMaxDelay < _tutorialTimer)
            {
                _introInProgress = false;
                _tutorialTimer   = 0;
            }

            _hazardTimer += Time.deltaTime;
            if (_hazardTimer < _hazardInterval)
            {
                return;
            }
            _hazardTimer = 0;

            if (_introduction.Count > 0)
            {
                TutorialHazard();
            }
            else
            {
                Hazard();
            }
        }