설비 KPI UI 가시성 개선
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user