void AutoPan() { float time = Time.realtimeSinceStartup; float delta = time - lastTime; lastTime = time; autoPanTime -= delta; Vector2 pos = Vector2.Lerp(autoPanTargetOffset, _zoomArea.ZoomOffset, autoPanTime); _zoomArea.PanTo(pos); if (autoPanTime == 0) { autoPan = false; } Repaint(); }
void InitControls() { _nodeSelection = new NodeSelection(); _nodeSelection.VisualEditor = this; _zoomArea = new ZoomableArea(1, 12, DrawZoomAreaContent); if (_loadedGraph != null) { _zoomArea.PanTo(_loadedGraph.ZoomOffset); } // Create the wire controller if (_loadedGraph != null) { _wireController = new WireController(_loadedGraph, this); } _nodeMenu = new GenericMenu(); }