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); } }