예제 #1
0
        void IEndDragHandler.OnEndDrag(PointerEventData eventData)
        {
            WireDrawer.GetInstance().Release();
            RaycastHit2D raycastHit = InputHandler.RayCast(Layers.Inlets);

            if (raycastHit.collider)
            {
                Inlet      inlet      = raycastHit.collider.gameObject.GetComponent <Inlet>();
                Connection connection = MainManager.GetInstance().Connect(patchBody.Patch.Id, Id, inlet.PatchBody.Patch.Id, inlet.Id);
                WireDrawer.GetInstance().AddConnection(connection.Id, this, inlet);
            }
        }
예제 #2
0
 public void Load(string filename)
 {
     processor.Clear(patchGraphManager.GetPatches());
     patchGraphManager.Clear();
     patchCreator.Clear();
     WireDrawer.GetInstance().Clear();
     patchGraphManager = serializer.Load(filename);
     Patch[] patches = patchGraphManager.GetPatches();
     processor.LoadPatches(patches);
     patchCreator.Load(patches);
     Connection[] connections = patchGraphManager.GetConnections();
     processor.LoadConnections(connections);
     WireDrawer.GetInstance().Load(connections);
 }
예제 #3
0
 void IDragHandler.OnDrag(PointerEventData eventData)
 {
     WireDrawer.GetInstance().Draw(InputHandler.GetTouchPosition());
 }
예제 #4
0
 void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
 {
     WireDrawer.GetInstance().StartDraw(gameObject, patchBody.Color);
 }
예제 #5
0
 void IDragHandler.OnDrag(PointerEventData eventData)
 {
     transform.position = (Vector2)InputHandler.GetTouchPosition() + offset;
     WireDrawer.GetInstance().MovePatch(this);
 }