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

Custom editor window to view and modify game object/prefab?

Discussion in 'Immediate Mode GUI (IMGUI)' started by menghui0330, Jun 29, 2016.

  1. menghui0330

    menghui0330

    Joined:
    Jan 12, 2016
    Posts:
    4
    Hi guys, I'm new to custom editor scripting and I'm currently trying to create a custom tool for my game so that the artist can view the prefabs and select the part(child object) to add and remove components based on their needs.

    The problem I'm facing now is to display and interact game object/prefab in the custom editor window, currently I'm trying to use OnInteractivePreviewGUI to achieve this, I have no problem on displaying it but I'm not able to click on the child object to select it like I do in scene view, I don't really know how to do it and not really sure if this is possible with OnInteractivePreviewGUI.

    So my question is..
    1. Is OnInteractivePreviewGUI the right way of doing it? Or I'm better to stick with something like a manager scene that contains my prefabs and some custom scene view GUI to achieve it?
    2. If so, how do I select the child inside the preview?
    3. Is it possible to add gizmo functions like draw cube to highlight them inside the preview so that I don't have to select them individually to know what kind of components they have?

    I hope you understand what I mean, thanks for reading and I will be grateful for any help you can provide.
     
    Last edited: Jun 29, 2016