void OnEnergyChange(DashProps e) { float ratio = e.EnergyRemain < 0f?0f : e.EnergyRemain; ratio = energyBarMaxHeight * ratio / e.MaxEnergy; energyBar.sizeDelta = new Vector2(energyBar.sizeDelta.x, ratio); }
void OnDashPrepare(DashProps e) { if (!dashUI.activeSelf) { dashUI.SetActive(true); } dashUI.transform.position = e.Pos; float degree = Math.GetDegree(e.Direction); targetSprite.size = new Vector2((e.Distance + .99f), 1f); arrowSprite.size = new Vector2(e.MaxDistance + 1f, 1f); dashUI.transform.rotation = Quaternion.Euler(0f, 0f, degree); }