2025-10-18 08:55:38 +08:00
|
|
|
using System;
|
|
|
|
|
using Core;
|
2025-10-20 10:12:07 +08:00
|
|
|
using Script.Gameplay.Player;
|
2025-10-19 19:38:52 +08:00
|
|
|
using TMPro;
|
2025-10-18 08:55:38 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
namespace UI
|
|
|
|
|
{
|
|
|
|
|
public class PlayerWatchModeViewer : UIBase
|
|
|
|
|
{
|
|
|
|
|
private PlayerWatchModeController watchModeController;
|
2025-10-19 19:38:52 +08:00
|
|
|
[SerializeField] private TMP_Text modeText;
|
2025-10-18 08:55:38 +08:00
|
|
|
|
2025-10-27 21:41:25 +08:00
|
|
|
protected override void Awake()
|
2025-10-18 08:55:38 +08:00
|
|
|
{
|
|
|
|
|
ControllerLocator.Instance.TryGetWait<PlayerWatchModeController>(OnGet);
|
|
|
|
|
}
|
2025-10-19 19:38:52 +08:00
|
|
|
|
2025-10-18 08:55:38 +08:00
|
|
|
private void OnGet(PlayerWatchModeController watchModeCtrl)
|
|
|
|
|
{
|
|
|
|
|
watchModeController = watchModeCtrl;
|
2025-10-29 08:13:11 +08:00
|
|
|
modeText.text = watchModeController.CurrentWatchMode.ToString();
|
|
|
|
|
watchModeController.OnEnterWatchMode += mode => modeText.text = mode.ToString();
|
2025-10-18 08:55:38 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|