2022-01-26 18:17:42 +03:00

31 lines
711 B
C#

using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class FloatingJoystick : Joystick
{
protected override void Start()
{
base.Start();
FadeJoystick(false);
}
public override void OnPointerDown(PointerEventData eventData)
{
background.anchoredPosition = ScreenPointToAnchoredPosition(eventData.position);
FadeJoystick(true);
base.OnPointerDown(eventData);
}
public override void OnPointerUp(PointerEventData eventData)
{
FadeJoystick(false);
base.OnPointerUp(eventData);
}
}