Newer
Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class DragDropW : MonoBehaviour, IDragHandler, IDropHandler
{
[SerializeField] private Canvas canvas;
private RectTransform rectransform;
private void Awake()
{
rectransform = GetComponent<RectTransform>();
if (Ui.nbObst == 0)
{
Destroy(this.gameObject);
Ui.nbObst++;
}
else
{
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor;
}
Ui.nbObst = Ui.nbObst - 1;
Ui.difficulty = Ui.difficulty + 1;
block = false;