This commit is contained in:
huyulong 2024-11-20 14:37:08 +08:00
parent a65704d9f7
commit 157401732c
4 changed files with 19000 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 75e1364f06afc644eb88b5591f7c5af2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,13 +14,13 @@ public class DragTheScreen : MonoBehaviour, IDragHandler
}
public void OnDrag(PointerEventData eventData)//屏幕移动
{
Debug.Log("====");
Player.GetComponent<PlayerMovement_Jpystick>().HandleViewSwipe();
Player.GetComponent<PlayerMovement_Jpystick>().HandleViewSwipe();
}
public void DragEvent(float x, float y)//摇杆移动
public void DragEvent(float x, float y, PointerEventData eventData)//摇杆移动
{
horizontal = x;
vertical = y;
horizontal = x;
vertical = y;
}

View File

@ -65,7 +65,7 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
}
public event Action<float, float> Drag;
public event Action<float, float, PointerEventData> Drag;
public event Action DragEnd;
public void OnDrag(PointerEventData eventData)
{
@ -79,7 +79,7 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
FormatInput();
HandleInput(input.magnitude, input.normalized, radius, cam);
handle.anchoredPosition = input * radius * handleRange;
Drag?.Invoke(Horizontal, Vertical);
Drag?.Invoke(Horizontal, Vertical, eventData);
}
public void OnEndDrag(PointerEventData eventData)
{