194 lines
5.8 KiB
C#
194 lines
5.8 KiB
C#
using CHN;
|
|
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using WI;
|
|
using TMPro;
|
|
|
|
namespace CHN
|
|
{
|
|
public class Panel_TopToolBar : PanelBase
|
|
{
|
|
public Button Button_Logo;
|
|
public Button Button_TotalProgress;
|
|
public Button Button_WorkProgress;
|
|
public Button Button_ProductionProgress;
|
|
public Button Button_AssemblyProgress;
|
|
public Button Button_FinalInspection;
|
|
public Button Button_AssemblyProgressLine;
|
|
public Button Button_MoldDepartment;
|
|
public Button Button_Alrams;
|
|
public Button Button_Setting;
|
|
public Button Button_Exit;
|
|
|
|
public Action onClickScreenInitialization;
|
|
public Action onClickTotalProgress;
|
|
public Action onClickWorkProgress;
|
|
public Action onClickProductionProgress;
|
|
public Action onClickAssemblyProgress;
|
|
public Action onClickFinalInspection;
|
|
public Action onClickAssemblyProgressLine;
|
|
public Action onClickMoldDepartment;
|
|
public Action onClickAlarms;
|
|
public Action onClickSetting;
|
|
public Action onClickExit;
|
|
|
|
public Action onClickCompleteTimeAlarm;
|
|
public Action<ViewMode> onChangeView;
|
|
|
|
private bool isClickable;
|
|
//public Image Image_Alarm;
|
|
|
|
public override void AfterAwake()
|
|
{
|
|
Button_Logo.onClick.AddListener(OnClickScreenInitialization);
|
|
Button_TotalProgress.onClick.AddListener(OnClickTotalProgress);
|
|
Button_WorkProgress.onClick.AddListener(OnClickWorkProgress);
|
|
Button_ProductionProgress.onClick.AddListener(OnClickProductionProgress);
|
|
Button_AssemblyProgress.onClick.AddListener(OnClickAssemblyProgress);
|
|
Button_FinalInspection.onClick.AddListener(OnClickFinalInspection);
|
|
Button_AssemblyProgressLine.onClick.AddListener(OnClickAssemblyProgressLine);
|
|
Button_MoldDepartment.onClick.AddListener(OnClickMoldDepartment);
|
|
Button_Alrams.onClick.AddListener(OnClickAlrams);
|
|
Button_Setting.onClick.AddListener(OnClickSetting);
|
|
Button_Exit.onClick.AddListener(OnClickExit);
|
|
|
|
//Image_Alarm.gameObject.SetActive(false);
|
|
}
|
|
|
|
public Func<int, Floor> GetFloor;
|
|
|
|
public void SetClickable(bool isClickable)
|
|
{
|
|
this.isClickable = isClickable;
|
|
}
|
|
private void OnClickScreenInitialization()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickScreenInitialization?.Invoke();
|
|
}
|
|
private void OnClickTotalProgress()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickTotalProgress?.Invoke();
|
|
}
|
|
private void OnClickWorkProgress()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickWorkProgress?.Invoke();
|
|
}
|
|
private void OnClickProductionProgress()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickProductionProgress?.Invoke();
|
|
}
|
|
private void OnClickAssemblyProgress()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickAssemblyProgress?.Invoke();
|
|
}
|
|
private void OnClickFinalInspection()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickFinalInspection?.Invoke();
|
|
}
|
|
private void OnClickAssemblyProgressLine()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickAssemblyProgressLine?.Invoke();
|
|
}
|
|
private void OnClickMoldDepartment()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickMoldDepartment?.Invoke();
|
|
}
|
|
private void OnClickAlrams()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickAlarms?.Invoke();
|
|
}
|
|
private void OnClickSetting()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickSetting?.Invoke();
|
|
}
|
|
private void OnClickExit()
|
|
{
|
|
if (isClickable)
|
|
return;
|
|
|
|
onClickExit?.Invoke();
|
|
}
|
|
|
|
//public void SetAlarmCount(int count)
|
|
//{
|
|
// var text = Button_Alrams.GetComponentInChildren<TMP_Text>();
|
|
// text.SetText(count.ToString());
|
|
//}
|
|
|
|
//private void OnClickCompleteTimeAlarm()
|
|
//{
|
|
// onClickCompleteTimeAlarm?.Invoke();
|
|
//}
|
|
//private void OnClickChangeView()
|
|
//{
|
|
// var currentViewMode = FindSingle<OrbitalController>().viewMode;
|
|
|
|
// switch (currentViewMode)
|
|
// {
|
|
// case ViewMode.PerspectiveView:
|
|
// onChangeView?.Invoke(ViewMode.FirstPersonView);
|
|
// break;
|
|
// case ViewMode.FirstPersonView:
|
|
// onChangeView?.Invoke(ViewMode.PerspectiveView);
|
|
// break;
|
|
// }
|
|
//}
|
|
|
|
//public void SetChangeViewState(int obj)
|
|
//{
|
|
// var targetFloor = GetFloor(obj);
|
|
// Color color;
|
|
// var isInteractable = !targetFloor.isEmptyFloor;
|
|
// if (targetFloor.isEmptyFloor)
|
|
// {
|
|
// color = Color.gray;
|
|
// }
|
|
// else
|
|
// {
|
|
// color = Color.white;
|
|
// }
|
|
|
|
// Button_ChangeView.GetComponentInChildren<TMP_Text>().color = color;
|
|
// Button_ChangeView.interactable = isInteractable;
|
|
//}
|
|
//public void SetChangeViewButtonState(bool isActive)
|
|
//{
|
|
// Color color = isActive ? Color.white : Color.gray;
|
|
// var isInteractable = isActive;
|
|
|
|
// Button_ChangeView.GetComponentInChildren<TMP_Text>().color = color;
|
|
// Button_ChangeView.interactable = isInteractable;
|
|
//}
|
|
}
|
|
} |