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

Prefabs in Prefabs plugin available now at the Asset Store

Discussion in 'Made With Unity' started by Babaa, Apr 11, 2012.

  1. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    Hi, I have finnished my Prefabs in Prefabs plugin to Unity and this is available on the Asset Store.

    http://u3d.as/content/databox-games/prefabs-in-prefabs-plugin/2Px

    This is a simple plugin to the Unity editor that allows you to place prefabs inside other prefabs without breaking any connection. To nest your prefabs.

    When this plugin is installed in your project you never have to worry about it again. This works completely in the background, and it just works.

    Here is a bad quality video from way back, I will make a new showcase video soon: http://www.youtube.com/watch?v=5ydMt1-deTI

    New showcase video: http://www.youtube.com/watch?v=b70UHvKBFe4&feature=youtu.be

    This was previosly known as "Nested Prefabs" but since there is another package with similar name on the Asset Store I have changed the name. This is also the reason why I made this new post, I am sorry about spamming the forum but I do not want any confusion.

    Here is the old post: http://forum.unity3d.com/threads/86417-Nested-Prefabs

    Best regards,
    Johan
     
    Last edited: Apr 13, 2012
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    very interesting !

    ( the youtube video does not work )
     
  3. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    Thanks for that. Fixed :)
     
  4. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    This looks like a must have tool, do you know what the differences are with this tool and the other two prefab tools in the asset store?
    I have had a hard time deciding to buy one of these or to wait for unity to implement this.
    It seems now that unity will take a long time for this.
    so now I have tree choices

    - Merlin's Prefap Lap,
    - NestedPrefab
    - Prefabs in Prefabs plugin.

    From what I can see on the video's your plugin seem the most integrated and seamless experience.
    Do you know if there are any dangers in using this plugin? ( lost connections thing like this )

    Thanks, and hope you don't mind me mentioning the other options, just want to get a clear picture for myself.
     
  6. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    The selling point of Prefabs in Prefabs is that it is completely automatic. I will try to compare the diffrent tools but ofcourse it will be biased and I haven't bought and tried the other tools. The authors of those tools are welcome to write the perks of using their tools here.

    Compared to Merlins:
    The Prefabs In Prefabs plugin also suports models. Merlins tool is not a tool to make nested prefabs but more a tool to deal with a very specific issue in the work flow working with Unity. The Prefabs in Prefabs plugin solves this issue but not in the same way. If you use the Prefabs in Prefabs plugin you would create a prefab and place the model as a child.

    Compared To NestedPrefab:
    NestedPrefab is a Prefab manageing tool. It's the cheapest of them all so if you don't want to spend much money and don't mind aditional workflow it's a good choise.

    Compare Conclusion: Merlins will deals with a specific issue in a neat way. NestedPrefab is a manageing tool for Prefabs. Prefabs in Prefabs is a plugin that allows you to nest your prefabs with no additional workflow.


    I have used this plugin for about 6 months and have had a lot of other people beta test it and I do not know of any issues. It works really good and seamless.
     
  7. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Thanks for the detailed reply, I can make a much better decision now :) Just hope everything will keep working when unity releases another major update. I'm a little scared to use such and essential tool all over the place and then find out unity breaks it and I cannot update to a new version.

    Off course this would be the fault of unity if such a thing would happen, just sharing my thoughts on this, thanks for making this great tool available for all to use!
     
  8. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    Would you feel more comfortable using it if I added an uninstall function?

    I wouldn't worry about future versions of Unity breaking your prefabs. 1. My plugin only uses documented Unity functions. 2. Worst case scenario: Unity changes something in their system that either makes the plugin redundant or unfunctionable, you would have the same result as before using the plugin. The only code that runs in executable is "Destoy(gameObject)" on one component. 3. It's open source so if you want to disable it, that would be very simple.

    What I am trying to say is that you can use this plugin and it will not F*** with your game at runtime. Your developing will just be very much more comfortable.
     
  9. Yorick2

    Yorick2

    Joined:
    Jan 24, 2009
    Posts:
    297
    This plugin looks very cool!

    I work at Paladin Studios, creator of Merlin's prefab lab and I can shed some light on the differences.

    Baba is right, Merlin's prefab lab will not allow you to do prefabs in prefabs. It solves a very specific issue in the art workflow, which is that adding components to your models will break the model/prefab connection. We iterate on our art a lot and Merlin saves me time.

    Which is great but often you want to add components directly onto the model's gameobjects. (parent particle systems to a jet, add colliders for each model part, scripts that use OnMouseover etc). That is what Merlin is for, to help with the art pipeline.

    So I think this tool and Merlin's prefab lab solve different problems and might even work together well. (i have not tried this yet).
     
  10. Flownerous

    Flownerous

    Joined:
    May 14, 2012
    Posts:
    5
    I was using the version in the old thread before. I uninstalled it after running into a problem. Thinking of getting the new one from the Asset Store.

    I would have a component in a prefab with a reference to another prefab nested within it. When the prefab nested within it was refreshed the reference to the nested prefab was lost. It seemed to be recreating the nested prefab instead of updating it, so losing the reference.

    Is this still a potential problem?
     
  11. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    Hi, I don't think so, but it might be. Could you send me an example scene and I will make sure that works before you buy it and potentially waste your money?

    Best regards,

    EDIT: Also, It has been greatly improved since the free version.
     
  12. Flownerous

    Flownerous

    Joined:
    May 14, 2012
    Posts:
    5
    Hey, I grabbed it anyway. I figure I can either fix the plugin or come up with a workaround if it's impossible.

    Here are detailed steps to reproduce:

    1. Create a new project with the Prefabs in Prefabs plugin.
    2. Write a component that stores a reference to another component.
      Code (csharp):
      1.  
      2. /// Reference.cs
      3.  
      4. using UnityEngine;
      5. using System.Collections;
      6.  
      7. public class Reference : MonoBehaviour
      8. {
      9.     public Reference m_Target;
      10. }
      11.  
    3. Create a new game object named "Nested"
    4. Add the component "Reference" to the "Nested" game object.
    5. Make a prefab out of the "Nested" game object.
    6. Create new game object named "Root"
    7. Add the component "Reference" to the "Root" game object.
    8. Add an instance of the "Nested" prefab as a child of the "Root" game object.
    9. Set the "m_Target" variable on "Root" to point to "Nested".
    10. Make a prefab out of the "Root" game object.
    11. Add a box collider component (for example) to the "Nested" game object.
    12. Apply changes to the "Nested" prefab.
    13. Note that the "m_Target" variable on "Root" is now pointing to "<none>".

    I think the unfortunate code is PrefUtils.Update, where it destroys the old prefab instance and creates a new instance. Not sure if there's a way around it. Considering just putting an attribute on the references I don't want to break and saving them / restoring them inside PrefUtils.Update.
     
    Last edited: May 25, 2012
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    I get one error when I try to build to iOS

    Assets/Prefabs In Prefabs/Scripts/DestroyOnCreate.cs(2,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?

    any idea?
     
  14. Hidden

    Hidden

    Joined:
    Apr 4, 2011
    Posts:
    20
    I have the same error on iOS as Lars, on an urgent project!

    I also have a problem using this along side NGUI, instantiated prefabs don't work properly with clipping
     
    Last edited: Jun 7, 2012
  15. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    Remove these lines for the DestroyOnCreate.cs:
    /////
    using UnityEditor;
    using System.Collections;

    [ExecuteInEditMode]
    /////

    DestroyOnCreate is only there to becouse of older versions of the plugin. It isn't used anymore.

    I will fix this and the other issues that's been reported in a patch asap.

    Best regards,
     
  16. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    You can also just surround the code with "#if UNITY_EDITOR"
     
  17. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    Hi Baba,

    I downloaded your plugin about an hour ago. I just tried updating one of the prefabs inside another prefab, but from the hierarchy (for clarity - prefab A is in prefab B. I modified prefab A from the hierarchy but my asset in the scene is not updated). It didn't work, but I did notice this error pop up:

    (prefabId == null)
    UnityEngine.Debug:LogError(Object)
    PrefUtils:UpdatePrefab(GameObject) (at Assets/Prefabs In Prefabs/Editor/PrefUtils.cs:33)
    Activator:OnDisable() (at Assets/Prefabs In Prefabs/Editor/Activator.cs:35)

    Does that tell you anything?

    PS - I created prefab B with existing prefabs in my project already. Could that be the reason?
     
    Last edited: Jun 25, 2012
  18. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    btw... I'm not sure if you noticed or not, but it seems like the preview window for large prefab groups is MUCH slower with the plugin installed.
     
  19. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    another question!

    while working in my project, it sometimes asks me to save prefabs that I have not worked on at all. Is that due to this plugin by chance?
     
  20. Babaa

    Babaa

    Joined:
    Nov 24, 2009
    Posts:
    47
    @stiltskin

    1. I responded to your email. You need to reimport old prefabs for them too work. Then nest them again (from scratch).
    2. Yes, I have fixed this issue but I am waiting too patch until I've fixed all the issues that have come up.
    3. Yes, it's the Activator that can cause this behaviour.

    Best regards,
     
  21. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    thanks for the reply! looking forward to the update. :)
     
  22. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    hey there,

    any time frame by chance on the next update for this plugin? The Unity slowdown problem is really starting to be an issue for us. Sometimes clicking on a prefab can take up to 20 secs before unity responds again.

    I also noticed that I cannot build anything. I get the error posted in this thread -
    "Assets/Prefabs In Prefabs/Scripts/HF.cs(2,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?"

    I applied the fix you mentioned, but I still get the error. Any other ideas?

    Thanks!
     
    Last edited: Jul 9, 2012
  23. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    hey Babaa,

    i got yet another showstopper. This one actually crashes Unity. It was caused by adding an animation to a prefab (that's being used in several other prefabs).

    The file 'MemoryStream' is corrupted! Remove it and launch unity again!
    [Position out of bounds!]
    UnityEditor.PrefabUtility:InstantiatePrefab(Object)
    PrefUtils:Update(GameObject, GameObject, PrefabId) (at Assets/Prefabs In Prefabs/Editor/PrefUtils.cs:60)
    PrefUtils:UpdatePrefab(GameObject) (at Assets/Prefabs In Prefabs/Editor/PrefUtils.cs:50)
    Activator:OnDisable() (at Assets/Prefabs In Prefabs/Editor/Activator.cs:35)


    Do you have any news on an update? The current state of the plugin is really causing some major showstoppers. I can't build a game at all (with the previously posted error), and now this new one is preventing my from changing a prefab.

    thanks.

    edit
    ok, I found a workaround. Instead of changing the prefab in the asset tree, I dragged it in the scene, added the animation and updated it. That worked just fine.
     
    Last edited: Jul 14, 2012
  24. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    Hi Babaa,

    This is another ping to find out what's going on with this plugin. Can you please post here with any updates? I think it's the least you owe people who paid you for this plugin.

    Thanks.
     
  25. electrov

    electrov

    Joined:
    Jan 12, 2012
    Posts:
    2
    Hi Babaa

    Does this work with FBX's too? So for example, if I have a prefab in my scene called "A", and then drag a FBX underneath it called "B", then save the changes to my prefab, will "B" update correctly in the scene if I update the FBX? I'm not sure if unity treats FBX's exactly like normal prefabs, so wasn't sure whether this would work?

    Thanks
     
  26. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    electrov-

    If you re-import a mesh, anywhere it's used will be updated. But if you use it directly it will get overwritten every time you import it. I suggest you make a prefab, set any changes to it you need, and use that as in your other prefabs. Then if you re-import, the mesh will update but not destroy your changes. At least that's the way it's been working for me with this plugin.

    I hope that helps.
     
  27. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    604
    so, the developer's last reply is dated 06-28-2012.

    1) is this asset still maintained ? what about the problems mentioned in this post ? were they fixed until now ?
    2) can I edit prefabs in the project and in the scene with out crashing or slowing down the unity ?
    3) does the build error still exists because of UnityEditor namespace ?
    4) what about the problem occurs when linking to a nested prefab from the parent prefab? (the most important thing for a nested prefab solution!!! if I can't have links to nested prefabs, how am I gonna drive them from the parent script???)

    I wanna make sure before buying it.
     
    Last edited: Jul 19, 2013
  28. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    There's still the exact problem. I'm losing reference to a prefab when pressing Ctrl+S in a scene. I wanted to use this plugin but it's not production ready in any way. It seems to work well but then connections are disappearing. I can just see that happening when i'm saving a scene.
     
  29. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    Moreover i get tons of bugs when trying to compile on iOS. There's no support for this plugin anymore?