修改
This commit is contained in:
parent
a65704d9f7
commit
157401732c
18986
xiaofang/Assets/Scenes/Tmap 1.unity
Normal file
18986
xiaofang/Assets/Scenes/Tmap 1.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
xiaofang/Assets/Scenes/Tmap 1.unity.meta
Normal file
7
xiaofang/Assets/Scenes/Tmap 1.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 75e1364f06afc644eb88b5591f7c5af2
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -14,11 +14,11 @@ public class DragTheScreen : MonoBehaviour, IDragHandler
|
|||||||
}
|
}
|
||||||
public void OnDrag(PointerEventData eventData)//屏幕移动
|
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;
|
horizontal = x;
|
||||||
vertical = y;
|
vertical = y;
|
||||||
|
|
||||||
|
@ -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 event Action DragEnd;
|
||||||
public void OnDrag(PointerEventData eventData)
|
public void OnDrag(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
|
|||||||
FormatInput();
|
FormatInput();
|
||||||
HandleInput(input.magnitude, input.normalized, radius, cam);
|
HandleInput(input.magnitude, input.normalized, radius, cam);
|
||||||
handle.anchoredPosition = input * radius * handleRange;
|
handle.anchoredPosition = input * radius * handleRange;
|
||||||
Drag?.Invoke(Horizontal, Vertical);
|
Drag?.Invoke(Horizontal, Vertical, eventData);
|
||||||
}
|
}
|
||||||
public void OnEndDrag(PointerEventData eventData)
|
public void OnEndDrag(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user