像这样如何通过拖放进行分支?

时间:2018-11-05 01:59:14

标签: drag-and-drop

我应该从以下代码中修复或添加什么内容,以便在将它们都拖完后可以检查是非? Drag and drop check tru or false

#region IDropHandler implementation
public void OnDrop(PointerEventData eventData)
{
    if (!item)
    {
        DragHandeler.itemBeingDragged.transform.SetParent(transform);
        //ExecuteEvents.ExecuteHierarchy<IHasChanged>(gameObject, null, (x, y) => x.HasChanged());
    }

    if (DragHandeler.itemBeingDragged != null)
    {
        if (DragHandeler.itemBeingDragged == CorrectAnswer)
        {
            Debug.Log("benar");
            StartCoroutine(LoadLevelAfterDelay(delay));
        }
        else
        {
            Debug.Log("salah");
        }
    }

}
#endregion

0 个答案:

没有答案