石头小改

This commit is contained in:
2024-12-26 20:33:15 +08:00
parent 901680e7d9
commit 654e7fe84d
16 changed files with 2166 additions and 1240 deletions
@@ -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))
{