Пример #1
0
        protected override void Initialize()
        {
            _marketFlipper = GetComponent <PanelFlipper>();

            foreach (var marketShip in LevelManager.DataBase.MarketShips)
            {
                var shipRepresentor = Instantiate(_shipRepresentor, _marketContent.transform);
                shipRepresentor.SetRepresentor(marketShip, _marketFlipper);
            }

            GuiEvent.ShowMarket.AddListener(SetPanelActive);
            _marketFlipper.Deactivate();
        }
Пример #2
0
        public void SetRepresentor(Ship target, PanelFlipper parentPanel)
        {
            _target      = target;
            _parentPanel = parentPanel;

            _shipIconHolder.sprite = _target.GetComponent <SpriteRenderer>().sprite;
            _shipNameText.text     = _target.ObjName;

            _hitPointsGValueGUi.SetFloatText(_target.HealthStats.HitPoints.StatValue);
            _shieldGValue.SetFloatText(_target.HealthStats.Shield.StatValue);
            _dpsGValueText.SetFloatText(_target.GetShipDps());
            _depthGValueText.SetFloatText(_target.MaxDepth);

            _shipPriceCreditsText.SetIntText(_target.ShipPriceCredits);
            _shipPriceMaterialsText.SetIntText(_target.ShipPriceMaterials);
        }
Пример #3
0
 protected override void Initialize()
 {
     _deathPanelFlipper = GetComponent <PanelFlipper>();
     LevelEvent.PlayerDeath.AddListener(SetDeathPanelActive);
     _deathPanelFlipper.Deactivate();
 }