Exemple #1
0
 private void SetHpBar(HPData data, int shipType)
 {
     hpData = data;
     if (shipType > 0)
     {
         this.shipType = shipType;
     }
     _uiHPSlider.value = Mathe.Rate(0f, data.maxHP, data.nowHP);
     _uiHPSlider.foregroundWidget.color = Util.HpGaugeColor2(hpData.maxHP, data.nowHP);
     if (_uiHPLabel != null)
     {
         _uiHPLabel.text = $"{data.nowHP}/{data.maxHP}";
     }
 }
Exemple #2
0
 private void SetHpBar(HPData data, int shipType)
 {
     this.hpData = data;
     if (shipType > 0)
     {
         this.shipType = shipType;
     }
     this._uiHPSlider.value = Mathe.Rate(0f, (float)data.maxHP, (float)data.nowHP);
     this._uiHPSlider.foregroundWidget.color = Util.HpGaugeColor2(this.hpData.maxHP, data.nowHP);
     if (this._uiHPLabel != null)
     {
         this._uiHPLabel.text = string.Format("{0}/{1}", data.nowHP, data.maxHP);
     }
 }
 private void UpdateSumHpGauge(BtlCut_UICircleHPGauge gauge, HPData hpData, Action act)
 {
     hpData.attackCnt--;
     hpData.nextHP -= hpData.oneAttackDamage[3 - hpData.attackCnt];
     if (hpData.attackCnt != 0)
     {
         gauge.SetHPGauge(hpData.maxHP, hpData.nowHP, hpData.nextHP);
         gauge.Play(act);
         hpData.nowHP = hpData.nextHP;
     }
     else
     {
         gauge.SetHPGauge(hpData.maxHP, hpData.nowHP, hpData.endHP);
         gauge.Play(delegate
         {
         });
         hpData.nowHP = hpData.nextHP;
     }
 }
Exemple #4
0
 public BattleData()
 {
     this._clsFriendFleetHP = new HPData(0, 0);
     this._clsEnemyFleetHP  = new HPData(0, 0);
 }