protected override void OnStartShowing()
        {
            UpdateProgress();
            levelText.SetText($"Level: {LevelsManager.GetLevel()}");

            holder.SetPositionY(500);
            progress.SetPositionY(-400);
        }
 private void OnSuccessfulCut(int left, int right)
 {
     text.SetText($"{GetImpression(Mathf.Abs(left - right))}\n{left}/{right}");
     text.Sequence(
         text.Fade(1, 0.2f).SetEase(Ease.InSine),
         text.Delay(1),
         text.Fade(0, 0.3f).SetEase(Ease.InSine)
         );
 }
        private void UpdateTexts()
        {
            hpText.SetText($"xp: {HPManager.GetHP()}");
            levelText.SetText($"level: {LevelsManager.GetLevel()}");

            float hpWidth    = hpText.GetTextComponent().preferredWidth;
            float levelWidth = levelText.GetTextComponent().preferredWidth;

            float fullSize = hpWidth + knobWidth + levelWidth;

            float hpPos    = -fullSize / 2 + hpWidth / 2;
            float knobPos  = hpPos + hpWidth / 2 + knobWidth / 2;
            float levelPos = knobPos + knobWidth / 2 + levelWidth / 2;

            hpText.SetPositionX(hpPos);
            knob.SetPositionX(knobPos);
            levelText.SetPositionX(levelPos);
        }
Example #4
0
 private void UpdateHpText()
 {
     hpText.SetText($"XP: {HPManager.GetHP()}");
 }
 private void UpdateProgress()
 {
     progressImage.fillAmount = (float)HPManager.GetCurrentProgress() / HPManager.GetMaxProgress();
     progressText.SetText($"{HPManager.GetCurrentProgress()}/{HPManager.GetMaxProgress()}");
 }
Example #6
0
 public void Show(string descKey, float delay = 2.0f, params string[] ps)
 {
     Timer.Restart();
     Show(true, null, delay);
     Desc.SetText(descKey, ps);
 }