Beispiel #1
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);
     }
 }
        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;
        }
Beispiel #3
0
        public void Tick()
        {
            if (_lost)
            {
                return;
            }

            if (transform.position.y < -5)
            {
                _lost = true;
                if (_createUIElement == null)
                {
                    _createUIElement = FindObjectOfType <CreateUIElement>();
                }
                _createUIElement.CreateElement(UIElement.GoldLost, transform.position, "-" + _goldValue + " GOLD!");
                _goldValue = 0;
                _treasureManager.ReCalculateGold();
            }
        }
Beispiel #4
0
 public void Init(TreasureManager treasureManager)
 {
     _createUIElement = FindObjectOfType <CreateUIElement>();
     _treasureManager = treasureManager;
     _hitPoint        = maxHitpoints;
 }