private static void Update(object sender, FrameEventArgs e) { for (int i = 0; i < canvases.Count; i++) { canvases[i].Update((float)e.Time); Over = canvases[i].GetIntersection() ?? Over; } Over?.OnMouseOver(); if (Over != lastOver) { Over?.OnMouseEnter(); } if (Over != lastOver) { lastOver?.OnMouseExit(); } if (Input.GetMouseButtonDown(MouseButton.Left)) { Drag = Over; Drag?.OnMouseDown(); } Drag?.OnMousePress(); if (Input.GetMouseButtonUp(MouseButton.Left)) { Drag?.OnMouseUp(); Drag = null; } lastOver = Over; Over = null; }