Override default drag and drop behavior inside editor

I’m trying to override the default drag and drop behavior inside the scene view for a prefab so the object is created through a factory instead of being directly instantiated. My idea is to intercept the drag and drop event in the OnSceneGUI method to introduce my behavior. Currently the method looks like this:

    void OnSceneGUI() {
        if (Event.current.type == EventType.DragExited) {
            // i have to use a flag because the DragExited event is fired twice (¿?)
            if(!_creating) { 
                WorldBuilder.Instance.AddPlatform( _myScript.length,_myScript.type);
                _creating = true;
            }
                
            DragAndDrop.AcceptDrag();
            Event.current.Use();
        }
    }

This creates the object via the Factory but it also instantiates a new one. I tried to clear the DragAndDrop.objectReferences array and add manually the factory object but it doesn’t work. Any idea on how i can achieve this?

It has been a while but i couldn’t find an elegant solution to this problem. I thought about adding the current _myScript object to the Factory instead of creating a new one but that goes against the pattern so i scraped the idea. For now i’m just destroying the object created:

     void OnSceneGUI() {
         if (Event.current.type == EventType.DragExited) {
             // i have to use a flag because the DragExited event is fired twice (¿?)
             if(!_creating) { 
                 WorldBuilder.Instance.AddPlatform( _myScript.length,_myScript.type);
                 _creating = true;

                 if (Application.isPlaying) {
                    GameObject.Destroy(_myScript.gameObject);
                 } else {
                    GameObject.DestroyImmediate(_myScript.gameObject);
                 }
             }
                 
             Event.current.Use();
         }
     }

This is a suboptimal solution but at least it works.