설비 강조 효과 기능 변경
This commit is contained in:
@@ -34,6 +34,7 @@ namespace CHN
|
||||
public Action onNotloadData;
|
||||
public Action<List<CompleteTimeAlarmData>> onUnloadData;
|
||||
public Action<List<CompleteTimeAlarmData>> onLoadData;
|
||||
public Action<Machine> onActiveHighLighter;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod]
|
||||
static void RunOnStart()
|
||||
@@ -69,6 +70,10 @@ namespace CHN
|
||||
foreach(var data in currentData)
|
||||
{
|
||||
var worknm = data.completeInfo.worknm;
|
||||
|
||||
if (saveData.ContainsKey(worknm))
|
||||
return;
|
||||
|
||||
saveData.Add(worknm, data);
|
||||
}
|
||||
}
|
||||
@@ -173,66 +178,10 @@ namespace CHN
|
||||
{
|
||||
if(machine.code == machineCode)
|
||||
{
|
||||
SetTargetPosToMachine(machine);
|
||||
ActivateMachinesHighlight(machine);
|
||||
onActiveHighLighter?.Invoke(machine);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ResetMachinesHighLight(string dashboardKey)
|
||||
{
|
||||
ResetAllMachinesHighLight();
|
||||
}
|
||||
|
||||
private void ResetAllMachinesHighLight()
|
||||
{
|
||||
foreach (var machine in machines)
|
||||
{
|
||||
machine.DeactivateTranslucent();
|
||||
machine.StopFlash();
|
||||
}
|
||||
}
|
||||
|
||||
private void ActivateMachinesHighlight(Machine alarmMachine)
|
||||
{
|
||||
ResetAllMachinesHighLight();
|
||||
|
||||
foreach (Machine machine in machines)
|
||||
{
|
||||
if (alarmMachine != machine)
|
||||
{
|
||||
machine.ActivateTranslucent();
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.StartFlash();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void SetTargetPosToMachine(Machine machine)
|
||||
{
|
||||
OrbitalController controller = FindSingle<OrbitalController>();
|
||||
if (controller.viewMode != ViewMode.PerspectiveView)
|
||||
{
|
||||
controller.SetViewMode(ViewMode.PerspectiveView);
|
||||
}
|
||||
|
||||
var building = FindSingle<Building>();
|
||||
int changeFloor = building.floors[0].floorIndex;
|
||||
|
||||
int libraryMachineFloor = machine.GetMachineFloorIndex();
|
||||
if (libraryMachineFloor > changeFloor)
|
||||
{
|
||||
changeFloor = libraryMachineFloor;
|
||||
}
|
||||
|
||||
var centerPos = machine.centerPos;
|
||||
|
||||
var slider = FindSingle<Canvas_Right>().panel_floorcontrol;
|
||||
slider.ChangeValueFromOutside(changeFloor);
|
||||
|
||||
controller.option.currentDistance = 20f;
|
||||
controller.SetTargetPos(centerPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user