27 lines
748 B
C#
27 lines
748 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class A3FT_Dropper : MonoBehaviour, IDropHandler
|
|
{
|
|
public A3FT_Question thisQuestion;
|
|
public int index;
|
|
public void SetupThis(int receivedIndex,A3FT_Question receivedQ)
|
|
{
|
|
thisQuestion = receivedQ;
|
|
index = receivedIndex;
|
|
}
|
|
|
|
public void OnDrop(PointerEventData data)
|
|
{
|
|
A3FT_Dragger temp = data.pointerDrag.GetComponent<A3FT_Dragger>();
|
|
if (temp.index == index)
|
|
{
|
|
temp.answered = true;
|
|
temp.toMove.parent = transform;
|
|
GameObject.Find("QuestionManager").GetComponent<A3FT_QuestionManager>().AddToAnswered();
|
|
}
|
|
}
|
|
}
|