Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MoveTEST.cs 562B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. public class MoveTEST : MonoBehaviour, IPointerDownHandler, IDragHandler
  6. {
  7. [SerializeField] GameObject Main_pic;
  8. private Vector3 offsete;
  9. public void OnPointerDown(PointerEventData eventData)
  10. {
  11. offsete = Main_pic.transform.position - Input.mousePosition;
  12. }
  13. public void OnDrag(PointerEventData eventData)
  14. {
  15. Main_pic.transform.position = Input.mousePosition + offsete;
  16. }
  17. }