feat(Connect): 完成连线基本玩法,
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Gameplay.Player;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -9,25 +10,18 @@ namespace UI
|
||||
public class PlayerWatchModeViewer : UIBase
|
||||
{
|
||||
private PlayerWatchModeController watchModeController;
|
||||
[SerializeField] private Text modeText;
|
||||
[SerializeField] private TMP_Text modeText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
ControllerLocator.Instance.TryGetWait<PlayerWatchModeController>(OnGet);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (watchModeController != null)
|
||||
{
|
||||
modeText.text = "Watch Mode: " + watchModeController.CurrentWatchMode.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnGet(PlayerWatchModeController watchModeCtrl)
|
||||
{
|
||||
watchModeController = watchModeCtrl;
|
||||
//Debug.Log("PlayerWatchModeViewer obtained PlayerWatchModeController.");
|
||||
modeText.text = "Watch Mode: " + watchModeController.CurrentWatchMode;
|
||||
watchModeController.OnEnterWatchMode += mode => modeText.text = "Watch Mode: " + mode;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user