private void Start() { playerUnit = Main.CurrentGameSession.PlayerGameObject.GetComponent <Unit>(); bar = gameObject.GetComponent <BasicProgressBar>(); Debug.Assert(bar != null); bar.CustomValueInterpreter = new ProgressBarValueInterpreter_HP(playerUnit); bar.SetValues(new BasicProgressBar.Values { current = playerUnit.CurrentHp, delta = 0, max = playerUnit.Hp, min = 0, target = playerUnit.CurrentHp }); }
public ChangeProgressBarValuesCommand(BasicProgressBar bar, BasicProgressBar.Values values) : base(0.5f) { this.bar = bar; this.values = values; }