public static void GridUpdate(SceneView sceneView)
        {
            var e = Event.current;

            if (e.isMouse)
            {
                EditorInputManager.FeedMouseEvent(e);
            }

            if (!PlaytimePainter.IsCurrentTool)
            {
                return;
            }

            if (e.isMouse)
            {
                if (e.button == 0)
                {
                    lMouseDwn = (e.type == EventType.MouseDown) && (e.button == 0);
                    lMouseUp  = (e.type == EventType.MouseUp) && (e.button == 0);
                }

                mousePosition = Event.current.mousePosition;

                var cam = Camera.current;

                var offScreen = (!cam || (mousePosition.x <0 || mousePosition.y <0 ||
                                                                                 mousePosition.x> cam.pixelWidth ||
                                                           mousePosition.y> cam.pixelHeight));

                if (!offScreen)
                {
                    var camTf = cam.transform;

                    EditorInputManager.centerRaySceneView = new Ray(camTf.position, camTf.forward);

                    mouseRayGui = HandleUtility.GUIPointToWorldRay(mousePosition);

                    EditorInputManager.mouseRaySceneView = mouseRayGui;

                    if (painter)
                    {
                        mouseRayGui = painter.PrepareRay(mouseRayGui);
                    }
                }
            }

            FeedEvents(e);

            if (e.isMouse)
            {
                RaycastHit hit;
                var        isHit = Physics.Raycast(mouseRayGui, out hit);

                var pp = isHit ? hit.transform.GetComponent <PlaytimePainter>() : null;

                var refocus = OnEditorRayHit_AllowRefocusing(hit, mouseRayGui);

                if (lMouseDwn && e.button == 0 && refocus && isHit)
                {
                    if (pp && pp == painter && AllowEditing(painter))
                    {
                        HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive));
                    }

                    QcUnity.FocusOn(hit.transform.gameObject);
                }

                #if !UNITY_2019_1_OR_NEWER
                if (!navigating && AllowEditing(painter))
                {
                    e.Use();
                }
                #endif
            }

            if (painter && painter.textureWasChanged)
            {
                painter.ManagedUpdateOnFocused();
            }
        }