설비 강조 효과 기능 변경
This commit is contained in:
@@ -10,6 +10,7 @@ namespace CHN
|
||||
{
|
||||
OrbitalController controller;
|
||||
public List<Machine> machines = new List<Machine>();
|
||||
public Machine currentClickMachine;
|
||||
|
||||
RaycastHit[] hitInfo = new RaycastHit[16];
|
||||
Canvas_Popup popupCanvas;
|
||||
@@ -71,19 +72,15 @@ namespace CHN
|
||||
Array.Sort(hitInfo, (hit1, hit2) => hit1.distance.CompareTo(hit2.distance));
|
||||
var hitColider = hitInfo[0].collider;
|
||||
|
||||
Machine machine = hitColider.GetComponent<Machine>();
|
||||
hitColider.TryGetComponent<Machine>(out var machine);
|
||||
|
||||
foreach(var floorMachine in floorMachines)
|
||||
foreach (var floorMachine in floorMachines)
|
||||
{
|
||||
if(floorMachine == machine)
|
||||
{
|
||||
if (machine == null)
|
||||
return;
|
||||
|
||||
if (leftClick)
|
||||
{
|
||||
onLeftClickMachine?.Invoke(machine);
|
||||
ActivateMachinesHighlight(machine);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,16 +117,6 @@ namespace CHN
|
||||
onClickThermostat?.Invoke();
|
||||
}
|
||||
}
|
||||
private void ActivateMachinesHighlight(Machine currentMachine)
|
||||
{
|
||||
foreach (var machine in machines)
|
||||
{
|
||||
machine.ResetTranslucent();
|
||||
machine.StopFlash();
|
||||
}
|
||||
currentMachine.DeactivateTranslucent();
|
||||
currentMachine.StartOneFlash();
|
||||
}
|
||||
private void RaycastOnClickProductionStatusBoard()
|
||||
{
|
||||
bool leftClick = Input.GetMouseButtonDown(0);
|
||||
|
||||
Reference in New Issue
Block a user