fix(ConnectUI): 让连接UI正确显示

This commit is contained in:
2025-10-20 20:05:24 +08:00
parent 9daa56a457
commit 56fab4ede4
2 changed files with 17 additions and 15 deletions

View File

@@ -9,13 +9,14 @@ namespace UI
{
public class PlayerConnectViewer : UIBase
{
public TMP_Text inputText;
public TMP_Text outputText;
public TMP_Text pointBText;
public TMP_Text pointAText;
private PlayerConnectController _playerConnectController;
private PlayerWatchModeController _playerWatchModeController;
private void Awake()
protected override void Awake()
{
base.Awake();
ControllerLocator.Instance.TryGetWait<PlayerConnectController>(OnGetConnectController);
ControllerLocator.Instance.TryGetWait<PlayerWatchModeController>(OnGetWatchModeController);
}
@@ -32,18 +33,18 @@ namespace UI
private void UpdateInputText(IConnectable input)
{
string text = input != null ? input.GetConnectableName() : "None";
if (inputText != null)
if (pointBText != null)
{
inputText.text = "Input: " + text;
pointBText.text = "pointB: " + text;
}
}
private void UpdateOutputText(IConnectable output)
{
string text = output != null ? output.GetConnectableName() : "None";
if (outputText != null)
if (pointAText != null)
{
outputText.text = "Output: " + text;
pointAText.text = "pointA: " + text;
}
}