Exemple #1
0
    public GameObject CheckOverInput()
    {
        if (EventSystem.current.IsPointerOverGameObject())
        {
            PointerEventData pointerData = new PointerEventData(EventSystem.current)
            {
                position = Input.mousePosition
            };
            List <RaycastResult> results = new List <RaycastResult>();
            EventSystem.current.RaycastAll(pointerData, results);

            for (int i = 0; i < results.Count; i++)
            {
                if (results[i].gameObject.tag == "EXInput")
                {
                    SMExecutionInput input = results[i].gameObject.GetComponent <SMExecutionInput>();
                    return(results[i].gameObject);
                }
            }
        }
        return(null);
    }
Exemple #2
0
 public void OnEndDrag(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         dragging = false;
         input    = CheckOverInput();
         if (input != null)
         {
             connected = true;
             SMExecutionInput EXin = input.GetComponent <SMExecutionInput>();
             EXin.Link(node);
             if (gameObject.tag == "EXOutputTwo")
             {
                 SMIF temp = (SMIF)node;
                 temp.SetNextFalse(EXin.node);
             }
             else
             {
                 node.SetNext(EXin.node);
             }
         }
     }
 }