using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class UpDownButtons : MonoBehaviour, IPointerUpHandler, IPointerDownHandler
{
public Camera cam;
public void OnPointerUp(PointerEventData eventData)
{
gameObject.transform.position = cam.ScreenToWorldPoint (new Vector3 (gameObject.transform.position.x, gameObject.transform.position.y + 6f, 0));
}
public void OnPointerDown(PointerEventData eventData)
{
gameObject.transform.position = cam.ScreenToWorldPoint(new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 6f, 0));
}
}
При нажатии она сразу же стает по z на 350 +-, а по y и x на 0