설비 강조 효과 기능 변경

This commit is contained in:
정영민
2025-04-03 11:53:25 +09:00
parent 23449465b7
commit 75cafaf761
68 changed files with 7475 additions and 5584 deletions

View File

@@ -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);
}
}
}

View File

@@ -0,0 +1,6 @@
using UnityEngine;
public class HighLighter : MonoBehaviour
{
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3698aa2d3eb96784a9a843d0bb35040c

View File

@@ -0,0 +1,71 @@
using UnityEngine;
using WI;
using CHN;
using System.Linq;
public class HighLighterManager : MonoBehaviour, ISingle
{
private Machine[] machines;
private Machine currentMachine;
public override void AfterStart()
{
var building = FindSingle<Building>();
machines = building.floors.SelectMany(f => f.machines).ToArray();
}
public void ActiveHighLighter(Machine highLightMachine)
{
foreach (var machine in machines)
{
machine.DeactiveHighLighter();
if (machine.machineKPI != null)
{
machine.machineKPI.Shrink();
}
}
currentMachine = highLightMachine;
currentMachine.ActiveHighLighter();
if (currentMachine.machineKPI != null)
{
currentMachine.machineKPI.Expand();
}
}
public void ResetAllHighLighter()
{
foreach (var machine in machines)
{
machine.DeactiveHighLighter();
if (machine.machineKPI != null)
{
machine.machineKPI.Shrink();
}
}
}
public 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 = 15f;
controller.SetTargetPos(centerPos);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 273ea45119e7530468f4e74e379c570b