완료 시간 알람 기능 복원 및 카메라 시점 기능 개발
This commit is contained in:
@@ -126,7 +126,10 @@ namespace CHN
|
||||
foreach (var machine in matchingMachines)
|
||||
{
|
||||
if (machine.GetComponentInParent<Floor>() != currentFloor)
|
||||
{
|
||||
machine.machineKPI.SetActive(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
MachineKPIsActive(machine, layerMask);
|
||||
|
||||
@@ -134,6 +137,16 @@ namespace CHN
|
||||
machineKPI.transform.localScale = originScale * distanceScale;
|
||||
}
|
||||
}
|
||||
bool IsScreenRange(Machine machine)
|
||||
{
|
||||
Vector3 viewPos = cam.camera.WorldToViewportPoint(machine.centerPos);
|
||||
|
||||
if (viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 && viewPos.y <= 1 && viewPos.z > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void MachineKPIsActive(Machine machine, LayerMask layerMask)
|
||||
{
|
||||
var dir = cam.camera.transform.localPosition - machine.centerPos;
|
||||
@@ -145,6 +158,9 @@ namespace CHN
|
||||
|
||||
if (hitCameraLayer)
|
||||
{
|
||||
if (!IsScreenRange(machine))
|
||||
return;
|
||||
|
||||
machine.machineKPI.Active();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CHN
|
||||
{
|
||||
var dic = new Dictionary<string, GameObject>();
|
||||
|
||||
dic.Add("완료 알람 시간", completeAlramHistory.gameObject);
|
||||
dic.Add("완료 시간 알람", completeAlramHistory.gameObject);
|
||||
dic.Add("라이브러리", library.gameObject);
|
||||
dic.Add("작업 조건 분석", workConditionAnalysis.gameObject);
|
||||
dic.Add("작업 시간 분석", workTimeAnalysis.gameObject);
|
||||
|
||||
@@ -24,6 +24,7 @@ public class Panel_ToolBar : PanelBase
|
||||
private CaptureBase capture;
|
||||
|
||||
public Action onClickDashBoard;
|
||||
public Action<ViewMode> onClickCameraView;
|
||||
public override void AfterAwake()
|
||||
{
|
||||
Button_TopView.onClick.AddListener(OnClickTopView);
|
||||
@@ -130,16 +131,16 @@ public class Panel_ToolBar : PanelBase
|
||||
|
||||
private void OnClickShoulderView()
|
||||
{
|
||||
Debug.Log("ShoulderView");
|
||||
onClickCameraView?.Invoke(ViewMode.FirstPersonView);
|
||||
}
|
||||
|
||||
private void OnClickQuaterView()
|
||||
{
|
||||
Debug.Log("QuaterView");
|
||||
onClickCameraView?.Invoke(ViewMode.PerspectiveView);
|
||||
}
|
||||
|
||||
private void OnClickTopView()
|
||||
{
|
||||
Debug.Log("TopView");
|
||||
onClickCameraView?.Invoke(ViewMode.TopView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,13 @@ namespace CHN
|
||||
public UI_DashboardCheckListItem prf_item;
|
||||
|
||||
private Dictionary<string, GameObject> originDashBoardItems = new();
|
||||
private Dictionary<string, UI_DashboardCheckListItem> dashboardItemList = new();
|
||||
public SDictionary<string, UI_DashboardCheckListItem> dashboardItemList = new();
|
||||
public void Init(Dictionary<string, GameObject> items)
|
||||
{
|
||||
prf_item = Resources.Load<UI_DashboardCheckListItem>("Prefabs/UI/UI_DashboardCheckListItem");
|
||||
|
||||
originDashBoardItems.Clear();
|
||||
dashboardItemList.Clear();
|
||||
foreach (var item in items)
|
||||
{
|
||||
var dashboardItem = CreateItem();
|
||||
@@ -35,9 +36,13 @@ namespace CHN
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCloseDashbordItem(string dahboardKey)
|
||||
public void OnOpenDashboardItem(string dashboardKey)
|
||||
{
|
||||
dashboardItemList[dahboardKey].ToggleOffItem();
|
||||
dashboardItemList[dashboardKey].ToggleOnItem();
|
||||
}
|
||||
public void OnCloseDashbordItem(string dashboardKey)
|
||||
{
|
||||
dashboardItemList[dashboardKey].ToggleOffItem();
|
||||
}
|
||||
private UI_DashboardCheckListItem CreateItem()
|
||||
{
|
||||
|
||||
@@ -48,6 +48,10 @@ namespace CHN
|
||||
toggleText.SetText(keyName);
|
||||
}
|
||||
|
||||
public void ToggleOnItem()
|
||||
{
|
||||
toggle.isOn = true;
|
||||
}
|
||||
public void ToggleOffItem()
|
||||
{
|
||||
toggle.isOn = false;
|
||||
|
||||
Reference in New Issue
Block a user