First Commit
This commit is contained in:
commit
eed6b79efc
2836 files changed
+948481
No files matched your search
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Главный контроллер интерфейса авторынка и телефона перекупа.
|
||||
/// Обеспечивает мост между сценой, CarMarketManager, современным SmartphoneUI и MeetingWaypointHUD.
|
||||
/// </summary>
|
||||
public class CarMarketUI : MonoBehaviour
|
||||
{
|
||||
[Header("Клавиши открытия телефона")]
|
||||
[SerializeField] private KeyCode toggleKeyPrimary = KeyCode.P;
|
||||
[SerializeField] private KeyCode toggleKeySecondary = KeyCode.M;
|
||||
|
||||
[Header("Ссылки")]
|
||||
[SerializeField] private CarMarketManager marketManager;
|
||||
[SerializeField] private SmartphoneUI smartphoneUI;
|
||||
[SerializeField] private MeetingWaypointHUD waypointHUD;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (marketManager == null)
|
||||
marketManager = GetComponent<CarMarketManager>() ?? FindAnyObjectByType<CarMarketManager>();
|
||||
|
||||
if (smartphoneUI == null)
|
||||
smartphoneUI = GetComponent<SmartphoneUI>() ?? FindAnyObjectByType<SmartphoneUI>();
|
||||
|
||||
if (smartphoneUI == null)
|
||||
{
|
||||
smartphoneUI = gameObject.AddComponent<SmartphoneUI>();
|
||||
}
|
||||
|
||||
if (waypointHUD == null)
|
||||
waypointHUD = GetComponent<MeetingWaypointHUD>() ?? FindAnyObjectByType<MeetingWaypointHUD>();
|
||||
|
||||
if (waypointHUD == null)
|
||||
{
|
||||
waypointHUD = gameObject.AddComponent<MeetingWaypointHUD>();
|
||||
}
|
||||
|
||||
// Гарантируем наличие аудиофидбека
|
||||
_ = PhoneAudioFeedback.Instance;
|
||||
}
|
||||
|
||||
public void ToggleMarket(bool open)
|
||||
{
|
||||
if (smartphoneUI != null)
|
||||
smartphoneUI.TogglePhone(open);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user