Search Unity

Use scene view and property grid in custom window

Discussion in 'Extensions & OnGUI' started by fettsnoken, May 25, 2018.

  1. fettsnoken

    fettsnoken

    Joined:
    Mar 30, 2015
    Posts:
    1
    Hi, I want a build a voxel editor which produces a model asset inside the Unity editor. For this I have a custom editor window. The editor window will have a set of toolbars, a property grid and of course a 3D scene view in which the voxels are edited.
    It would be very nice if I could reuse the existing scene view already used by unity for the editing of normal game scenes as well as the existing property grid. Is this is any way possible? Do note that this scene view needs to be scoped to only present the voxels (in whatever way they are represented).
    The model asset which is the output of this editor should be updated more or less in realt ime and be visible in the normal scene view where used.
     
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    571
    Yes, this is possible. For drawing GUI to and interacting with the scene view, you can use the
    Editor.OnSceneGUI
    message or the undocumented
    SceneView.onSceneGUIDelegate
    event.

    You can use the EditorSceneManager to create a new empty scene in which to work.