Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Create a LevelEditor (with a custon EditorWindow) without modifying the current scene.

Discussion in 'Immediate Mode GUI (IMGUI)' started by NicolasHognon, Jul 23, 2014.

  1. NicolasHognon

    NicolasHognon

    Joined:
    Nov 15, 2010
    Posts:
    32
    Hello,

    I have developed a little editor for a game I am working one (one my spare time).
    This editor is used to build "pattern" (saved as prefab) which will be used to build random level during the game.

    At this my custom EditorWindow is used to display elements is used to build my pattern, give a name and save the pattern. And the elements are assembled in the SceneView. The EditorWindow also snap in a grid elements (if I want to).

    But making things like this means I am modifying the current scene. So I am looking for a solution to use a scene which is part of my EditorWindow and to render this scene in my EditorWindow.

    I have found Handles.DrawCamera which can be used to renderer the current scene to my EditorWindow.

    But is it possible to render object into my EditorWindow without adding them to the current scene ?

    No sure my question is clear but I hope so.

    Thanks

    Nicolas
     
  2. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    Just a question, why don't you want to modify your current scene? And assuming you just don't want to dirty it, why not create a sandbox scene just for building your prefab patterns?

    I understand your problem, but maybe there's a simpler solution to it. :)
     
  3. NicolasHognon

    NicolasHognon

    Joined:
    Nov 15, 2010
    Posts:
    32
    Yes I just want to not dirty it. I have a scene called LevelEditor. But each time I reload my Game scene from the LevelEditor scene I am prompted "do you want to save the scene". Ok it is not a big problem but I just want to know if there is a cleaner solution.

    My LevelEditor has it own window with its own "sceneview" so I do not have to load my "special" scene. I can be in Game scene, open the LevelEditor window, create a pattern, save it, it play and "voila".

    But as you said, it is not my biggest problem (which is making the game) so I will not lose a lot of time on it if I did not find a solution ... but as I am curious I decided to ask for it here before stopping looking for it (the solution).

    But thank you for your advice.
     
    Last edited: Jul 23, 2014