public void SetMaxHpValue(int value) { if (!hpProgressor) { maxHP = value; return; } hpProgressor.SetMax(value); }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); save = GameObject.FindGameObjectWithTag("SaveState").GetComponent <SaveState>(); src = GetComponent <AudioSource>(); src.Play(); timeProgressor.SetMax(maxLoseTime); currentPressureValue += thermalToggle.currentValue; currentPressureValue += lowerToggle.currentValue; currentPressureValue += emergencyToggle.currentValue; currentPressureValue += mainToggle.currentValue; targetPressureValue = currentPressureValue; }
protected virtual void InitPersonParameters() { _personAnimator = GetComponent <PersonAnimatorDragonBones>(); _personAnimator.AnimationTimeScale = AnimationTimeScaleParameter.Value; HealthParameter.OnChangeValue.AddListener(health => { if (health >= HealthParameter.MaxValue) { health = HealthParameter.MaxValue; } HpProgressor.SetValue(health); }); HpProgressor.SetMax(HealthParameter.MaxValue); HealthParameter.Value = HealthParameter.MaxValue; }
protected override void InitPersonParameters() { base.InitPersonParameters(); EnergyParameter.OnChangeValue.AddListener(energy => { if (energy >= EnergyParameter.MaxValue) { energy = EnergyParameter.MaxValue; } if (energy <= 0) { energy = 0; } EnergyProgressor.SetValue(energy); }); EnergyProgressor.SetMax(EnergyParameter.MaxValue); EnergyProgressor.SetValue(EnergyParameter.Value); HealthParameter.OnChangeValue.AddListener(health => { EnergyParameter.Value += EnergyParameter.MaxValue / 10; }); }
public BattleStateUI updateMaxSP(int sp) { spProgressor.SetMax(sp); return(this); }
public BattleStateUI updateMaxHP(int hp) { hpProgressor.SetMax(hp); return(this); }