hellbound/Assets/Scripts/Game/UI/Windows/JoystickWindow.cs

33 lines
683 B
C#
Raw Normal View History

2021-11-26 11:16:25 +03:00
using Lean.Gui;
using UnityEngine;
using UnityEngine.Events;
public class JoystickWindow : ParameterlessWindow
{
public LeanJoystick Joystick => _joystick;
[SerializeField] private LeanJoystick _joystick;
[SerializeField] private GameObject _tutorial;
private void Awake()
{
_joystick.OnDown.AddListener(OnJoystickDown);
_joystick.UpTransitions.Begin();
}
private void OnJoystickDown()
{
if (_tutorial.gameObject.activeSelf)
HideTutorial();
}
public void ShowTutorial()
{
_tutorial.SetActive(true);
}
public void HideTutorial()
{
_tutorial.SetActive(false);
}
}