Initialer Upload neues Unity-Projekt
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UISettingsPanelOpenButton : MonoBehaviour
|
||||
{
|
||||
private UISettingsPanel _uiSettingsPanel;
|
||||
private Button _openButton;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_uiSettingsPanel = FindObjectOfType<UISettingsPanel>();
|
||||
_openButton = GetComponent<Button>();
|
||||
|
||||
_openButton.onClick.AddListener(OpenSettingsPanel);
|
||||
}
|
||||
|
||||
private void OpenSettingsPanel()
|
||||
{
|
||||
_uiSettingsPanel.ToggleSettingsPanel(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user