ZoeAppClass/Assets/Jogos/LaughGame/Scripts/LGB_QuestionDropper.cs

26 lines
773 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class LGB_QuestionDropper : MonoBehaviour, IDropHandler
{
public int order = 0;
public Transform txtTransform;
public void OnDrop(PointerEventData data)
{
if (order == data.pointerDrag.GetComponent<LGB_AnswerDragger>().order)
{
LGB_SoundPlayer.instance.PlaySfx(0);
data.pointerDrag.GetComponent<LGB_AnswerDragger>().ttTransform.parent = txtTransform;
data.pointerDrag.GetComponent<LGB_AnswerDragger>().isAnswered = true;
LGB_QuestionManager.instance.CheckAnswers(true);
}
else
{
LGB_SoundPlayer.instance.PlaySfx(2);
}
}
}