using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class A11G6Droper : MonoBehaviour, IDropHandler { public A11G6QuestionClass thisQuestion; private Image thisImage; public void SetupThis(A11G6QuestionClass rQ) { thisImage = GetComponent(); thisQuestion = rQ; thisImage.sprite = thisQuestion.questionImage; } public void OnDrop(PointerEventData data) { A11G6Dragger temp = data.pointerDrag.GetComponent(); if (temp.thisAnswer.isCorrect) { temp.answered = true; A11G6QuestionManager.instance.CorrectAnswer(); } else { A11G6QuestionManager.instance.WrongAnswer(); } } }