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

37 lines
794 B
C#
Raw Permalink Normal View History

2021-12-29 20:50:11 +03:00
using Lean.Gui;
using UnityEngine;
using UnityEngine.Events;
namespace RND
{
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);
}
}
}