설비 KPI UI 가시성 개선

This commit is contained in:
정영민
2025-02-25 10:23:33 +09:00
parent 96f4549e7a
commit 3c62a253b7
16 changed files with 4121 additions and 1471 deletions

View File

@@ -16,6 +16,8 @@ namespace CHN
private List<Machine> matchingMachines = new();
private SDictionary<string, UI_MachineKPI> machineKPIs = new();
private UI_MachineKPI current_MachineKPI;
public float defaultNameHeight;
public float radius;
public Vector3 originScale;
@@ -39,6 +41,7 @@ namespace CHN
var machineKPI = Instantiate(prefab_MachineKPI, transform);
machineKPI.SetData(data);
machineKPI.onClickKPI += OnClickMachineKPI;
machineKPI.name = data.workcd;
machineKPIs.Add(data.workcd, machineKPI);
@@ -59,10 +62,34 @@ namespace CHN
}
}
}
private void OnClickMachineKPI(UI_MachineKPI machineKPI)
{
if (current_MachineKPI != null)
{
current_MachineKPI.Shrink();
}
current_MachineKPI = machineKPI;
current_MachineKPI.Expand();
}
private void Update()
{
SettingPos();
RangeDetection();
RectangleContainsPoint();
}
private void RectangleContainsPoint()
{
if (Input.GetMouseButton(0))
{
if (current_MachineKPI == null)
return;
if(!RectTransformUtility.RectangleContainsScreenPoint(current_MachineKPI.DetailsKPI, Input.mousePosition))
{
current_MachineKPI.Shrink();
current_MachineKPI = null;
}
}
}
bool Test(Machine machine)
{