Skip to content

Commit 6a0db6d

Browse files
committed
edit: convent text to tmp pro all ui
1 parent 6fbe961 commit 6a0db6d

File tree

18 files changed

+2127
-2036
lines changed

18 files changed

+2127
-2036
lines changed

Assets/Code/UI/Game/StartLevelInfoDisplayer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
using TMPro;
12
using UnityEngine;
2-
using UnityEngine.UI;
33

44
namespace Code.UI.Game
55
{
@@ -8,7 +8,7 @@ public class StartLevelInfoDisplayer : MonoBehaviour
88
private const string TriggerPlay = "Play";
99

1010
[SerializeField] private Animator _animator;
11-
[SerializeField] private Text _textLevelName;
11+
[SerializeField] private TMP_Text _textLevelName;
1212

1313
public bool IsActive { get; private set; }
1414

Assets/Code/UI/Menu/Windows/Map/ItemLevel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using Code.Services.SFX.Sound;
4+
using TMPro;
45
using UnityEngine;
56
using UnityEngine.UI;
67
using Zenject;
@@ -10,7 +11,7 @@ namespace Code.UI.Menu.Windows.Map
1011
public class ItemLevel : MonoBehaviour
1112
{
1213
[SerializeField] private Image _mainImage;
13-
[SerializeField] private List<Text> _texts;
14+
[SerializeField] private List<TMP_Text> _texts;
1415
[SerializeField] private Button _button;
1516
[Space(10)]
1617
[SerializeField] private GameObject _panelCompleted;

Assets/Code/UI/Widget.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using DG.Tweening;
2+
using TMPro;
23
using UnityEngine;
3-
using UnityEngine.UI;
44

55
namespace Code.UI
66
{
77
public class Widget : MonoBehaviour
88
{
9-
[SerializeField] private Text _text;
9+
[SerializeField] private TMP_Text _text;
1010
[SerializeField] private CanvasGroup _canvasGroup;
1111

1212
private float _moveUpDuration = 0.5f;

Assets/Code/Window/Finish/FinishWindow.cs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
using System.Collections.Generic;
33
using Code.UI;
44
using DG.Tweening;
5+
using TMPro;
56
using UnityEngine;
67
using UnityEngine.UI;
78

89
namespace Code.Window.Finish
910
{
1011
public abstract class FinishWindow : MonoBehaviour
1112
{
12-
[SerializeField] protected Text _textTime;
13-
[SerializeField] protected Text _textScore;
13+
[SerializeField] protected TMP_Text _textTime;
14+
[SerializeField] protected TMP_Text _textScore;
1415
[SerializeField] protected Button _buttonLoadLevel;
1516
[SerializeField] protected Button _buttonExitToMenu;
1617
[Space(10)] [Header("Addition Components")]
@@ -63,18 +64,34 @@ public virtual void OpenWindow(Action onFinished)
6364
sequence.AppendInterval(0.2f);
6465
sequence.Append(_headerContainer.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBounce));
6566
sequence.AppendInterval(0.2f);
66-
sequence.Append(_textScore.DOText(_score, 0.25f).SetEase(Ease.Linear));
67-
sequence.Append(_textTime.DOText(_time, 0.25f).SetEase(Ease.Linear));
67+
68+
int parsedScore = int.TryParse(_score, out var s) ? s : 0;
69+
int currentScore = 0;
70+
sequence.Append(DOTween.To(() => currentScore, x =>
71+
{
72+
currentScore = x;
73+
_textScore.text = currentScore.ToString();
74+
}, parsedScore, 0.25f).SetEase(Ease.Linear));
75+
76+
float parsedTime = float.TryParse(_time, out var t) ? t : 0f;
77+
float currentTime = 0;
78+
sequence.Append(DOTween.To(() => currentTime, x =>
79+
{
80+
currentTime = x;
81+
_textTime.text = currentTime.ToString("F1");
82+
}, parsedTime, 0.25f).SetEase(Ease.Linear));
83+
6884
sequence.AppendInterval(0.2f);
6985
sequence.Append(_buttonLoadLevel.transform.DOScale(1, 0.5f).SetEase(Ease.OutBounce));
7086
sequence.Join(_buttonExitToMenu.transform.DOScale(1, 0.5f).SetEase(Ease.OutBounce));
87+
7188
sequence.OnComplete(() =>
7289
{
73-
_buttonScalers.ForEach(x=> x.SetupScaleOrigin());
90+
_buttonScalers.ForEach(x => x.SetupScaleOrigin());
91+
onFinished?.Invoke();
7492
});
75-
76-
sequence.OnComplete(() => onFinished?.Invoke());
7793
}
94+
7895

7996
protected abstract void OnLoadLevelButtonClick();
8097
protected abstract void OnExitToMenuButtonClick();

Assets/Code/Window/Finish/Win/BonusWindow.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using Code.Infrastructure.StateMachine;
22
using Code.Infrastructure.StateMachine.Game.States;
3-
using Code.Services.Levels;
4-
using Code.Services.SFX;
53
using Code.Services.SFX.Sound;
64
using Code.Services.StaticData;
75
using Zenject;

Assets/Resources/Huds/LoadingCurtain.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ MonoBehaviour:
103103
m_BlockingObjects: 0
104104
m_BlockingMask:
105105
serializedVersion: 2
106-
m_Bits: 4294967295
106+
m_Bits: 55
107107
--- !u!114 &7063499391173149961
108108
MonoBehaviour:
109109
m_ObjectHideFlags: 0

Assets/Resources/Infrastructure/MusicService.prefab

Lines changed: 0 additions & 145 deletions
This file was deleted.

Assets/Resources/Infrastructure/MusicService.prefab.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)