File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
UnityParticleSystemPreview/Assets/ParticleSystemPreview/Editor Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1- using UnityEngine ;
1+ using System . Reflection ;
2+ using UnityEngine ;
23using UnityEditor ;
34
45[ CustomEditor ( typeof ( GameObject ) ) , CanEditMultipleObjects ]
@@ -140,4 +141,18 @@ public override void ReloadPreviewInstances()
140141 baseEditor . ReloadPreviewInstances ( ) ;
141142 }
142143 }
144+
145+ /// <summary>
146+ /// 需要调用 GameObjectInspector 的场景拖曳,否则无法拖动物体到 Scene 视图
147+ /// </summary>
148+ /// <param name="sceneView"></param>
149+ public void OnSceneDrag ( SceneView sceneView )
150+ {
151+ System . Type t = baseEditor . GetType ( ) ;
152+ MethodInfo onSceneDragMi = t . GetMethod ( "OnSceneDrag" , BindingFlags . Instance | BindingFlags . Public | BindingFlags . NonPublic ) ;
153+ if ( onSceneDragMi != null )
154+ {
155+ onSceneDragMi . Invoke ( baseEditor , new object [ 1 ] { sceneView } ) ;
156+ }
157+ }
143158}
You can’t perform that action at this time.
0 commit comments