Newer
Older
John Schihada
committed
using UnityEngine;
using UnityEngine.EventSystems;
public class DropHandling : MonoBehaviour, IDropHandler
{
GameObject current;
John Schihada
committed
public DropHandling associatedDropHandling;
var scrollFact = gameObject.GetComponent<RenderedScrollFact>();
Debug.Log(eventData.pointerDrag.GetComponent<FactWrapper>().fact.Label+ " was dropped on "
+ gameObject.name+ " " +scrollFact.ID + "/" +
ScrollDetails.ParameterDisplays.Count+" label: "+scrollFact.Label);
John Schihada
committed
John Schihada
committed
Destroy(associatedDropHandling.current);
current = Instantiate(eventData.pointerDrag,Vector3.zero, Quaternion.identity);
John Schihada
committed
associatedDropHandling.current = Instantiate(current);
John Schihada
committed
associatedDropHandling.current.transform.SetParent(associatedDropHandling.gameObject.transform, false);
currentFact = eventData.pointerDrag.GetComponent<FactWrapper>().fact;
Debug.Log("recieved Fact: " + currentFact.backendURI);