层级改动

This commit is contained in:
2025-01-04 20:46:40 +08:00
parent 654e10fdb7
commit 69a3c9c93c
19 changed files with 6510 additions and 3277 deletions
@@ -1,4 +1,3 @@
using System;
using System.Linq;
using AibisDream.Framework;
using AibisDream.Kit;
@@ -13,13 +12,12 @@ namespace AibisDream.FixSystem
#region
[HideInInspector]public BodyModule[] BodyModules { get; private set; }
[HideInInspector]public CableSystem CableSystem { get; private set; }
public BodyModule[] BodyModules { get; private set; }
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,17 +38,17 @@ namespace AibisDream.FixSystem
#region
public bool inHotErr;
private int heatValue;
public int HeatValue
private int _heatValue;
private int HeatValue
{
get => heatValue;
get => _heatValue;
set
{
heatValue = value;
inHotErr = heatValue > 0;
_heatValue = value;
inHotErr = _heatValue > 0;
}
}
[HideInInspector]public BodyModule curBodyModule;
#endregion
@@ -68,10 +66,11 @@ namespace AibisDream.FixSystem
CableSystem = transform.Find("Cable System").GetComponent<CableSystem>();
bodyModuleGroup = transform.Find("Body Module Group");
oscilloscopeSystem = transform.Find("Oscilloscope System").GetComponent<OscilloscopeSystem>();
if(transform.Find("HeatMapController"))
if (transform.Find("HeatMapController"))
{
heatMapController=transform.Find("HeatMapController").GetComponent<HeatMapController>();
heatMapController = transform.Find("HeatMapController").GetComponent<HeatMapController>();
}
Debug.Log("Register");
FixSystemCenter.SystemDic.Register(this);
}
@@ -99,6 +98,7 @@ namespace AibisDream.FixSystem
{
continue; // 跳过不可用的模块
}
float tempDistance = Vector3.Distance(sourcePos, bodyModule.GetSocketPos());
if (tempDistance < closestDistance)
@@ -120,6 +120,7 @@ namespace AibisDream.FixSystem
return false;
}
}
/// <summary>
/// 寻找指定名称的BodyModule
/// </summary>
@@ -131,61 +132,53 @@ namespace AibisDream.FixSystem
}
/// <summary>
/// 深入检查
/// </summary>
public void HandleDeepIn()
{
if (CableSystem.curBodyModule)
{
CableSystem.curBodyModule.DeepIn();
}
}
/// <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();
_heatValue = 0;
}
/// <summary>
/// 插头重新插入初始插孔
/// </summary>
@@ -193,6 +186,7 @@ namespace AibisDream.FixSystem
{
CableSystem.ResetPlug();
}
#region
public override string[] GetDataKeyOptions()
@@ -207,7 +201,7 @@ namespace AibisDream.FixSystem
Debug.Log("配置项名称为空");
return;
}
if (!ConfigUtil.Instance.TryLoadConfig<BodyModuleSystemData>(DataPath + CurDataKey,
out var data))
{