This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AW_2025/Assets/Scripts/WSH/ControlPanel.cs
2025-02-24 15:18:12 +09:00

47 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WSH.UI;
namespace WSH
{
public class ControlPanel : MonoBehaviour
{
public static string controllerTag = "Hand";
[SerializeField] Tag_EmergencyButton button_Emergency;
[SerializeField] Tag_RunButton button_Run;
[SerializeField] UI_Panel_PermissionCheck panel_PermissionCheck;
[SerializeField] UI_Panel_Run panel_Run;
private void Awake()
{
button_Emergency = GetComponentInChildren<Tag_EmergencyButton>();
button_Run = GetComponentInChildren<Tag_RunButton>();
button_Emergency.triggerEvent = OnClick_Emergency;
button_Run.triggerEvent = OnClick_Runing;
panel_PermissionCheck = GetComponentInChildren<UI_Panel_PermissionCheck>();
panel_Run = GetComponentInChildren<UI_Panel_Run>();
}
void OnClick_Emergency()
{
Debug.Log($"OnClickEvent:ControlPanelEmergencyStop");
if (panel_PermissionCheck.gameObject.activeSelf)
{
return;
}
panel_PermissionCheck.Active();
}
void OnClick_Runing()
{
Debug.Log($"OnClickEvent:ControlPanelRun");
if (panel_Run.gameObject.activeSelf)
{
return;
}
panel_Run.gameObject.SetActive(true);
}
}
}