using UnityEngine;using UnityEngine.EventSystems;public Transform frogger;public class TouchControl : MonoBehaviour, IBeginDragHandler, IDragHandlerprivate SpriteRenderer spriteRenderer;private void Awake() { spriteRenderer = GetComponent(); }{ public void OnBeginDrag(PointerEventData eventData) { if (Mathf.Abs(eventData.delta.x) > Mathf.Abs(eventData.delta.y)) { if (eventData.delta.x > 0) { frogger.position += Vector3.right; } else { frogger.position += Vector3.left; } } else { if (eventData.delta.y > 0) { frogger.position += Vector3.up; } else { frogger.position += Vector3.down; } } } public void OnDrag(PointerEventData eventData) { }}
private void Awake() { spriteRenderer = GetComponent(); } { // Эта скобка нафига тут? public void OnBeginDrag(PointerEventData eventData) {