Newer
Older
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
//! @authors cgroxy
//! @brief "Insérer description rapide"
//! @details "Insérer description détaillée"
public class DragDropM : MonoBehaviour, IDragHandler, IDropHandler
// Champs privés
private RectTransform rectransform; //!< "Insérer description de la variable"
public TMP_Text textshowed; //!< "Insérer description de la variable"
bool block = true; //!< "Insérer description de la variable"
private void Awake()
{
rectransform = GetComponent<RectTransform>();
//! @param enventData Donnée de l'event @b OnDrop(PointerEventData)
//! @brief "Insérer description rapide"
//! @details "Insérer description détaillée"
if (Ui.nbObst == 0)
{
Destroy(this.gameObject);
Ui.nbObst++;
}
else
{
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor;
}
//! @param enventData Donnée de l'event @b OnDrop(PointerEventData)
//! @brief "Insérer description rapide"
//! @details "Insérer description détaillée"
Ui.nbObst = Ui.nbObst - 1;
Ui.difficulty = Ui.difficulty + 2;
block = false;