石头小改
This commit is contained in:
@@ -12,13 +12,12 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 内部索引
|
||||
|
||||
[HideInInspector]public BodyModule[] BodyModules { get; private set; }
|
||||
[HideInInspector]public CableSystem CableSystem { get; private set; }
|
||||
[HideInInspector] public BodyModule[] BodyModules { get; private set; }
|
||||
[HideInInspector] public CableSystem CableSystem { get; private set; }
|
||||
public GameObject bodyModulePrefab;
|
||||
[HideInInspector]public Transform bodyModuleGroup;
|
||||
[HideInInspector]public OscilloscopeSystem oscilloscopeSystem;
|
||||
[HideInInspector]public HeatMapController heatMapController;
|
||||
|
||||
[HideInInspector] public Transform bodyModuleGroup;
|
||||
[HideInInspector] public OscilloscopeSystem oscilloscopeSystem;
|
||||
[HideInInspector] public HeatMapController heatMapController;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -40,6 +39,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public bool inHotErr;
|
||||
private int heatValue;
|
||||
|
||||
public int HeatValue
|
||||
{
|
||||
get => heatValue;
|
||||
@@ -49,7 +49,8 @@ namespace AibisDream.FixSystem
|
||||
inHotErr = heatValue > 0;
|
||||
}
|
||||
}
|
||||
[HideInInspector]public BodyModule curBodyModule;
|
||||
|
||||
[HideInInspector] public BodyModule curBodyModule;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,7 +68,10 @@ namespace AibisDream.FixSystem
|
||||
CableSystem = transform.Find("Cable System").GetComponent<CableSystem>();
|
||||
bodyModuleGroup = transform.Find("Body Module Group");
|
||||
oscilloscopeSystem = transform.Find("Oscilloscope System").GetComponent<OscilloscopeSystem>();
|
||||
heatMapController=transform.Find("HeatMapController").GetComponent<HeatMapController>();
|
||||
if (transform.Find("HeatMapController"))
|
||||
{
|
||||
heatMapController = transform.Find("HeatMapController").GetComponent<HeatMapController>();
|
||||
}
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
}
|
||||
|
||||
@@ -89,6 +93,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
continue; // 跳过不可用的模块
|
||||
}
|
||||
|
||||
float tempDistance = Vector3.Distance(sourcePos, bodyModule.GetSocketPos());
|
||||
|
||||
if (tempDistance < closestDistance)
|
||||
@@ -110,6 +115,7 @@ namespace AibisDream.FixSystem
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 寻找指定名称的BodyModule
|
||||
/// </summary>
|
||||
@@ -130,52 +136,56 @@ namespace AibisDream.FixSystem
|
||||
CableSystem.curBodyModule.DeepIn();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
/// <summary>
|
||||
/// 设置死循环状态
|
||||
/// </summary>
|
||||
public void SetModuleState_CantStopRunning(string moduleName,bool state)
|
||||
public void SetModuleState_CantStopRunning(string moduleName, bool state)
|
||||
{
|
||||
BodyModule result = FindBodyModuleByName(moduleName);
|
||||
if (result != null)
|
||||
{
|
||||
Debug.Log("Found module: " + moduleName);
|
||||
result.data.cantStopRunning=state;
|
||||
result.data.cantStopRunning = state;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Module not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置发热
|
||||
/// </summary>
|
||||
|
||||
public void SetHeat(int targetHeatValue)
|
||||
{
|
||||
HeatValue = targetHeatValue;
|
||||
|
||||
HeatValue=targetHeatValue;
|
||||
|
||||
heatMapController.SetTemptureDirect(HeatValue);
|
||||
heatMapController.SetTemptureDirect(HeatValue);
|
||||
}
|
||||
|
||||
public void ShowHeatMap()
|
||||
{
|
||||
heatMapController.ShowHeatMap();
|
||||
ResetPlug();
|
||||
}
|
||||
|
||||
public void HideHeatMap()
|
||||
{
|
||||
heatMapController.HideHeatMap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 冷却后处理
|
||||
/// </summary>
|
||||
public void OnCooling()
|
||||
{
|
||||
if (!inHotErr) return;
|
||||
if (!inHotErr) return;
|
||||
// 系统冷却
|
||||
heatValue = 0;
|
||||
curBodyModule?.ShowWave();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插头重新插入初始插孔
|
||||
/// </summary>
|
||||
@@ -183,6 +193,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
CableSystem.ResetPlug();
|
||||
}
|
||||
|
||||
#region 数据加载与保存
|
||||
|
||||
public override string[] GetDataKeyOptions()
|
||||
@@ -197,7 +208,7 @@ namespace AibisDream.FixSystem
|
||||
Debug.Log("配置项名称为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!ConfigUtil.Instance.TryLoadConfig<BodyModuleSystemData>(DataPath + CurDataKey,
|
||||
out var data))
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using Febucci.UI;
|
||||
using Random = UnityEngine.Random;
|
||||
using System.Collections;
|
||||
|
||||
@@ -13,7 +12,7 @@ namespace AibisDream.FixSystem
|
||||
#region 组件索引
|
||||
|
||||
private BodyModuleSystem _bodyModuleSystem;
|
||||
public TMP_Text state; // 显示状态的TextMeshPro组件
|
||||
private TMP_Text _state; // 显示状态的TextMeshPro组件
|
||||
private TMP_Text _screenText;// 显示消息的TextMeshPro组件
|
||||
private WaveformLine _waveformLine;
|
||||
private ScanLine _scanLine;
|
||||
@@ -42,6 +41,7 @@ namespace AibisDream.FixSystem
|
||||
_bodyModuleSystem = GetComponentInParent<BodyModuleSystem>();
|
||||
|
||||
_screenText = transform.Find("Screen Text").GetComponent<TMP_Text>();
|
||||
_state = transform.Find("Screen State Text").GetComponent<TMP_Text>();
|
||||
_waveformLine = transform.Find("Waveform Visualizer").GetComponent<WaveformLine>();
|
||||
_scanLine = transform.Find("Scan Line").GetComponent<ScanLine>();
|
||||
_screen = transform.Find("Screen").GetComponent<SpriteRenderer>();
|
||||
@@ -167,30 +167,30 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public void MessageBoxSetError()
|
||||
{
|
||||
state.text = "错误";
|
||||
state.color = Color.red; // 红色
|
||||
_state.text = "错误";
|
||||
_state.color = Color.red; // 红色
|
||||
// _screenText.text = message;
|
||||
// _screenText.color = Color.white; // 默认文本颜色
|
||||
}
|
||||
|
||||
public void MessageBoxSetWarning()
|
||||
{
|
||||
state.text = "警告";
|
||||
state.color = new Color(1.0f, 0.55f, 0.0f); // 琥珀色
|
||||
_state.text = "警告";
|
||||
_state.color = new Color(1.0f, 0.55f, 0.0f); // 琥珀色
|
||||
// _screenText.text = message;
|
||||
// _screenText.color = Color.white; // 默认文本颜色
|
||||
}
|
||||
public void MessageBoxSetNormal()
|
||||
{
|
||||
state.text = "正常";
|
||||
state.color = Color.blue; // 琥珀色
|
||||
_state.text = "正常";
|
||||
_state.color = Color.blue; // 琥珀色
|
||||
// _screenText.text = message;
|
||||
// _screenText.color = Color.white; // 默认文本颜色
|
||||
}
|
||||
public void MessageBoxSetChecking()
|
||||
{
|
||||
state.text = "检查中";
|
||||
state.color = Color.white; // 琥珀色
|
||||
_state.text = "检查中";
|
||||
_state.color = Color.white; // 琥珀色
|
||||
// _screenText.text = string.Empty;
|
||||
// _screenText.color = Color.white; // 默认文本颜色
|
||||
}
|
||||
@@ -201,8 +201,8 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
public void MessageBoxSetNull()
|
||||
{
|
||||
state.text = "未检测到信号";
|
||||
state.color = Color.white; // 蓝色
|
||||
_state.text = "未检测到信号";
|
||||
_state.color = Color.white; // 蓝色
|
||||
_screenText.text = "";
|
||||
_screenText.color = Color.white; // 默认文本颜色
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user