예제 #1
0
 // Drop On
 public void OnDrop(PointerEventData _PointerEventData)
 {
     if (_PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Move> () != null)
     {
         NodeUtilityGroupRenderer NewNodeUtilityGroupRenderer = _PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Move> ().GameObject_NodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
         if (NewNodeUtilityGroupRenderer != null)
         {
             NewNodeUtilityGroupRenderer.SetParent(GameObject.Find("NodeGroup").transform);
             NewNodeUtilityGroupRenderer.SetIsDraggable(false);
             NewNodeUtilityGroupRenderer.UpdatePositionByIndex(NodeSpacePosition);
             Debug.Log("MOVE DROP!");
         }
     }
     else if (_PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Create> () != null)
     {
         NodeUtilityGroupRenderer NewNodeUtilityGroupRenderer = _PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Create> ().GameObject_NodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
         if (NewNodeUtilityGroupRenderer != null)
         {
             GameObject NewNodeUtilityGroup = NewNodeUtilityGroupRenderer.GetButton_Create().GetComponent <NodeUtilityGroup_Button_Create>().GetNewNodeUtilityGroup();
             NewNodeUtilityGroupRenderer = NewNodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
             NewNodeUtilityGroupRenderer.SetParent(GameObject.Find("NodeGroup").transform);
             NewNodeUtilityGroupRenderer.SetIsDraggable(false);
             NewNodeUtilityGroupRenderer.UpdatePositionByIndex(NodeSpacePosition);
             Debug.Log("CREATE DROP!");
         }
     }
 }
예제 #2
0
 // Pointer Enter
 public void OnPointerEnter(PointerEventData _PointerEventData)
 {
     if (_PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Move> () != null)
     {
         NodeUtilityGroupRenderer NewNodeUtilityGroupRenderer = _PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Move> ().GameObject_NodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
         if (NewNodeUtilityGroupRenderer != null)
         {
             NewNodeUtilityGroupRenderer.SetParent(transform);
             NewNodeUtilityGroupRenderer.SetIsDraggable(false);
             NewNodeUtilityGroupRenderer.SetIsNewPosition(true);
             Debug.Log("MOVE IN!");
         }
     }
     else if (_PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Create> () != null)
     {
         NodeUtilityGroupRenderer NewNodeUtilityGroupRenderer = _PointerEventData.pointerDrag.GetComponent <NodeUtilityGroup_Button_Create> ().GameObject_NodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
         if (NewNodeUtilityGroupRenderer != null)
         {
             GameObject NewNodeUtilityGroup = NewNodeUtilityGroupRenderer.GetButton_Create().GetComponent <NodeUtilityGroup_Button_Create>().GetNewNodeUtilityGroup();
             NewNodeUtilityGroupRenderer = NewNodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ();
             NewNodeUtilityGroupRenderer.SetParent(transform);
             NewNodeUtilityGroupRenderer.SetIsDraggable(false);
             NewNodeUtilityGroupRenderer.SetIsNewPosition(true);
             Debug.Log("CREATE IN!");
         }
     }
 }