public SkeletonManager(HazardData skeleton, Player[] players, ShipManager shipManager)
 {
     _skeletonData   = skeleton;
     _players        = players;
     _enemyCondition = shipManager.GetShip(ShipType.Enemy);
     _shipCondition  = shipManager.GetShip(ShipType.Player);
 }
Example #2
0
        void Start()
        {
            _shipCondition = GetComponent <ShipCondition>();
            _postProcessing.TryGet(out Fog fog);
            _maximumHeightInitial = fog.maximumHeight.value;
            _postProcessing.TryGet(out HDRISky sky);
            _initialSkyLux = sky.desiredLuxValue.value;

            ToggleFog(_fogOn);
        }
        private void FindTarget()
        {
            var ships = FindObjectsOfType <ShipCondition>();

            foreach (var ship in ships)
            {
                if (ship.ShipType != _shipCondition?.ShipType)
                {
                    _enemyCondition = ship;
                }
            }
        }
        private void Start()
        {
            _shipCondition  = GetComponentInParent <ShipCondition>();
            _particleSystem = GetComponentsInChildren <ParticleSystem>();
            _spawnPos       = GetComponentInChildren <ItemSpawn>();
            _audioPool      = FindObjectOfType <AudioSourcePoolManager>();

            if (_spawnPos == null)
            {
                Debug.LogError("Missing spawn position script on children objects. You need to create a child game object and assign ItemSpawn script to it");
            }
        }
Example #5
0
 void Start()
 {
     _shipCondition     = GetComponentInParent <ShipCondition>();
     _interactParticles = GetComponentInChildren <InteractParticles>();
     _createUIElement   = FindObjectOfType <CreateUIElement>();
     if (_createUIElement)
     {
         var go = _createUIElement.CreateElement(UIElement.ProgressBar, transform.position);
         _bar = go.GetComponent <FixProgressBar>();
         _bar.Init(0, _fixingTime, transform.position);
         _bar.gameObject.SetActive(false);
     }
 }
Example #6
0
        public void Init(FloatVariable roundTime, ShipCondition ship)
        {
            _roundTime  = roundTime;
            _playerShip = ship;

            if (_easyHazards.Count == 0 || _mediumHazards.Count == 0 || _hardHazards.Count == 0 ||
                _introduction.Count == 0)
            {
                Debug.LogError("Missing hazards from lists");
            }

            EventManager.TriggerEvent("SpawnEnemyShip", new EventManager.EventMessage(_enemyShip));
        }
        void Start()
        {
            _shipCondition     = GetComponentInParent <ShipCondition>();
            _interactParticles = GetComponentInChildren <InteractParticles>();
            _createUIElement   = FindObjectOfType <CreateUIElement>();
            var go = _createUIElement.CreateElement(UIElement.ProgressBar, transform.position);

            _bar = go.GetComponent <FixProgressBar>();
            _bar.Init(0, _fixingTime, transform.position);
            _bar.gameObject.SetActive(false);
            _audioSource = GetComponent <AudioSource>();
            _audioSource.outputAudioMixerGroup = _audioEvent.MixerGroup;
        }
Example #8
0
        void Start()
        {
            _navMeshLink = GetComponent <NavMeshLink>();
            var ships = FindObjectsOfType <ShipCondition>();

            foreach (var s in ships)
            {
                if (s.ShipType == ShipType.Player)
                {
                    _playerShip = s;
                }
            }
            _shipHealth = _playerShip.GetHealth();
        }
Example #9
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 #10
0
 public void Init(ShipCondition ship)
 {
     _ship           = ship;
     _navMeshSurface = FindObjectOfType <NavMeshSurface>();
     _navMeshSurface.BuildNavMesh();
 }
Example #11
0
 private void Start()
 {
     _ship       = GetComponent <ShipCondition>();
     _moveTarget = new Vector3(0, 0, _moveDistance);
 }