重构
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
@@ -6,26 +7,42 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
#region 组件索引
|
||||
|
||||
private OscilloscopeViewer _oscilloscopeViewer;
|
||||
private BodyModuleSystem _bodyModuleSystem;
|
||||
|
||||
private TMP_Text _screenText;
|
||||
|
||||
#endregion
|
||||
|
||||
public void InitComponentRefs()
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_oscilloscopeViewer = transform.Find("Oscilloscope Viewer").GetComponent<OscilloscopeViewer>();
|
||||
InitComponentRefs();
|
||||
}
|
||||
|
||||
public void DeepIn()
|
||||
private void InitComponentRefs()
|
||||
{
|
||||
// 插线系统不正常就返回
|
||||
if (!_bodyModuleSystem.IsPlugInSocket())
|
||||
{
|
||||
_oscilloscopeViewer.ShowScreenMessage("未插入任何目标模块");
|
||||
return;
|
||||
}
|
||||
_screenText = transform.Find("Screen Text").GetComponent<TMP_Text>();
|
||||
|
||||
//
|
||||
// TODO 回头找个IOC容器一起管
|
||||
_bodyModuleSystem = FindObjectOfType<BodyModuleSystem>();
|
||||
|
||||
_screenText.text = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
public void ShowScreenMessage(string message)
|
||||
{
|
||||
_screenText.text = message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除消息
|
||||
/// </summary>
|
||||
public void ClearScreenMessage()
|
||||
{
|
||||
_screenText.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user