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(); }
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); }
protected override void Initialize() { _deathPanelFlipper = GetComponent <PanelFlipper>(); LevelEvent.PlayerDeath.AddListener(SetDeathPanelActive); _deathPanelFlipper.Deactivate(); }