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); } }
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); }
void IDragHandler.OnDrag(PointerEventData eventData) { WireDrawer.GetInstance().Draw(InputHandler.GetTouchPosition()); }
void IBeginDragHandler.OnBeginDrag(PointerEventData eventData) { WireDrawer.GetInstance().StartDraw(gameObject, patchBody.Color); }
void IDragHandler.OnDrag(PointerEventData eventData) { transform.position = (Vector2)InputHandler.GetTouchPosition() + offset; WireDrawer.GetInstance().MovePatch(this); }