Интерфейс, конфиги камер
This commit is contained in:
1 parent
efad72b4d9
commit
e5f4f292c2
66 files changed
+11465
-9059
No files matched your search
@@ -10,10 +10,12 @@ namespace Code.UI
|
||||
public override void Hide()
|
||||
{
|
||||
_background.enabled = false;
|
||||
base.Hide();
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
_background.enabled = true;
|
||||
base.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Code.Gameplay.Orders.Order;
|
||||
using Code.Gameplay.Player;
|
||||
using DG.Tweening;
|
||||
using TMPro;
|
||||
@@ -15,12 +16,16 @@ namespace Code.UI.Panels
|
||||
[SerializeField] private float dispatcherTransitionTime = 0.5f;
|
||||
[Header("Timer")]
|
||||
[SerializeField] private TMP_Text timer;
|
||||
[SerializeField] private Image timerBackGround;
|
||||
public TMP_Text Timer => timer;
|
||||
[SerializeField] private RectTransform timerHiddenPosition;
|
||||
[SerializeField] private RectTransform timerShownPosition;
|
||||
[SerializeField] private float timerTransitionTime = 0.5f;
|
||||
[Header("HealthBar")]
|
||||
[SerializeField] private Image healthBar;
|
||||
[Header("MoneyBar")]
|
||||
[SerializeField] private TMP_Text moneyText;
|
||||
|
||||
|
||||
private void MoneyUpdate(int count, int money)
|
||||
{
|
||||
// TODO Анимация получения\потери
|
||||
@@ -32,7 +37,9 @@ namespace Code.UI.Panels
|
||||
float fillAmount = (float)health.HealthPoints / health.MaxHealthPoints;
|
||||
healthBar.fillAmount = fillAmount;
|
||||
}
|
||||
public void Initialize(PlayerMoney money, PlayerHealth health)
|
||||
private IOrderService _orderService;
|
||||
|
||||
public void Initialize(PlayerMoney money, PlayerHealth health, IOrderService orderService)
|
||||
{
|
||||
money.OnMoneyGet += MoneyUpdate;
|
||||
money.OnMoneyLoose += MoneyUpdate;
|
||||
@@ -40,22 +47,37 @@ namespace Code.UI.Panels
|
||||
|
||||
health.OnDamage += HealthUpdate;
|
||||
HealthUpdate(0,health);
|
||||
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_orderService != null) timer.text = ((int)_orderService.DeliveryTimer).ToString();
|
||||
}
|
||||
private int _dispatcherCalls;
|
||||
public void SummonDispatcher()
|
||||
{
|
||||
// TODO
|
||||
dispatcher.transform.DOMoveX(dispatcherShownPosition.position.x, dispatcherTransitionTime);
|
||||
_dispatcherCalls++;
|
||||
dispatcher.transform.DOMoveY(dispatcherShownPosition.position.y, dispatcherTransitionTime);
|
||||
}
|
||||
public void CloseDispatcher()
|
||||
{
|
||||
dispatcher.transform.DOMoveX(dispatcherHiddenPosition.position.x, dispatcherTransitionTime);
|
||||
_dispatcherCalls--;
|
||||
if (_dispatcherCalls > 0) return;
|
||||
dispatcher.transform.DOMoveY(dispatcherHiddenPosition.position.y, dispatcherTransitionTime);
|
||||
// TODO
|
||||
}
|
||||
public override void Hide()
|
||||
public void ShowTimer()
|
||||
{
|
||||
// TODO
|
||||
timerBackGround.transform.DOMoveX(timerShownPosition.position.x, timerTransitionTime);
|
||||
}
|
||||
public override void Show()
|
||||
public void HideTimer()
|
||||
{
|
||||
}
|
||||
timerBackGround.transform.DOMoveX(timerHiddenPosition.position.x, timerTransitionTime);
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,14 @@ namespace Code.UI.Panels
|
||||
[SerializeField] private TMP_Text vyapWatermark;
|
||||
public override void Hide()
|
||||
{
|
||||
Shown = false;
|
||||
background.enabled = false;
|
||||
loadingTitle.enabled = false;
|
||||
vyapWatermark.enabled = false;
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
Shown = true;
|
||||
background.enabled = true;
|
||||
loadingTitle.enabled = true;
|
||||
vyapWatermark.enabled = true;
|
||||
|
||||
@@ -38,15 +38,7 @@ namespace Code.UI.Panels
|
||||
|
||||
_cinematicDoorOpening = new(mainMenuUIVariables.MainMenuDoor, mainMenuUIVariables.DoorLight);
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Hide()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private void OpenStart() => _cinematicDoorOpening.PreOpen(0);
|
||||
|
||||
private void OpenSettings() => _cinematicDoorOpening.PreOpen(1);
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace Code.UI
|
||||
{
|
||||
public abstract class UIElement : MonoBehaviour
|
||||
{
|
||||
public abstract void Show();
|
||||
public abstract void Hide();
|
||||
public bool Shown { get; protected set; }
|
||||
public virtual void Show() => Shown = true;
|
||||
public virtual void Hide() => Shown = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user