Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Prefab Evolution Plugin(nested prefabs)

Discussion in 'Works In Progress' started by PrefabEvolution, Mar 27, 2014.

  1. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi.

    You've just stumbled onto the best prefab management tool available.
    Prefab Evolution offers advanced nested prefab and prefab-inheritance support, perfectly integrated with the Unity editor. Once you use it, you'll never want to work without it again. Seriously.

    Nested prefabs offer the ability to create, modify, and save prefabs within other prefabs, without breaking any existing prefab connections.

    Prefab inheritance goes a step further, letting you create prefabs that share a common ancestry, while maintaining the relationships between each prefab in the "family tree."

    These features enable incredible new workflows, making it easy to build and maintain even the most complex objects and systems inside your project.

    Features:
    - Works flawlessly with Unity Free and Unity Pro.
    - Full UnityUI and nGUI support.
    - Inherit from prefabs created by the model importer.
    - Expose any prefab properties for better prefab encapsulation.
    - Full source code included.

    Demo:


    Replace Demo:


    Unity 4.6 UI + Prefab Evolution:


    Available on Asset Store:
    Prefab Evolution

    Now i wait for your comments about it.
     
    Last edited: Feb 22, 2015
  2. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
  3. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Yes C#. The workflow that presents Unity i don't like much. They change a lot prefab philosophy. They says Prefab = couple of Objects with connection between them, and some property out from box. But i need some more control over...
     
  4. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Video published. Wait for comments)
     
  5. vakym

    vakym

    Joined:
    Jul 10, 2013
    Posts:
    1
    :D Very cool, I think many people will help with projects. Where is the plugin available?
     
  6. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    It's not available yet. After testing it will published in Asset Store. Think after 1-2 weeks...
     
  7. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    Good plugin :)

    As I say before Apply Button is Hell :) Do you have plans to publish with sources so I can replace this button?
     
  8. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Why you so hate this button?:)
     
  9. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Some Unity secret for you:
    Code (csharp):
    1.  
    2.  
    3. [CustomEditor(typeof(GameObject))]
    4. [CanEditMultipleObjects]
    5. public class OverrideGameObjectInternalEditor : Editor
    6. {
    7.     protected override void OnHeaderGUI()
    8.     {
    9.         //Your GameObject inspector header GUI
    10.     }
    11. }
    12.  
     
  10. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    Thanks I know this trick but there I need more code or inhewrit from Unity GameObject Editor :)

    I hate this button because just one click on it crash project.

    If I have instances of some prefab in 100 places in many scenes and in place1 click apply and after that in place2 click apply then prefab from place1 will loose all scene pecific tuning an all of it will be replaced to settings from place2.

    LevelDesigner click apply button very often and we have problems in many scenes after just onle ckick of some LevelDesigner.
    So I disable this button.

    Solution from that Unity present on Unite2012 eliminate this bug but keep all posibilities that we have today. So I create it for our team. But we have no prefab nesting :) So I also need to remove apply button in your context menu!

    I talk to Oleg Pridiuk (Unity Evangelist). Hi sad that we can do with current prefab system we can do with new when it will come.

    Why you do not like it? I do not fully understand your pre post about -> Prefab = couple of Objects with connection between them, and some property out from box
     
  11. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    " do not fully understand your pre post about -> Prefab = couple of Objects with connection between them, and some property out from box"
    This solution is good for Level designers. But it hell fro programmers. How you can change properties by code, that was exposed from prefab?
    Only for you :) :
    Code (csharp):
    1.  
    2. using UnityEditor;
    3. using UnityEngineInternal;
    4. using UnityEngine;
    5. using UnityEditorInternal;
    6. using System.Reflection;
    7.  
    8. [System.AttributeUsage(System.AttributeTargets.Class)]
    9. public class OverrideInternalEditorTypeMarkAttribute:System.Attribute
    10. {
    11.     public System.Type type;
    12.     public OverrideInternalEditorTypeMarkAttribute(string typeName)
    13.     {
    14.         var types = System.Reflection.Assembly.GetAssembly(typeof(Editor)).GetTypes();
    15.         foreach(var type in types)
    16.         {
    17.             if (type.Name != typeName)
    18.                 continue;
    19.            
    20.             this.type = type;
    21.             break;
    22.         }
    23.         if (this.type == null)
    24.             Debug.LogError("Type not found:"  + typeName);
    25.     }
    26. }
    27. public class OverrideInternalEditor : Editor
    28. {
    29.     public Editor _baseEditor;
    30.     public Editor baseEditor
    31.     {
    32.         get
    33.         {
    34.             if (_baseEditor == null)
    35.             {
    36.                 var atr = System.Attribute.GetCustomAttribute(this.GetType(), typeof(OverrideInternalEditorTypeMarkAttribute)) as OverrideInternalEditorTypeMarkAttribute;
    37.                 if (atr != null)
    38.                 {
    39.                     if (this.targets != null  this.targets.Length > 0)
    40.                         _baseEditor = CreateEditor(this.targets, atr.type);
    41.                 }
    42.                 else
    43.                 {
    44.                     Debug.Log("A!!!!!!!!!!!!");
    45.                 }
    46.             }
    47.             return _baseEditor;
    48.         }
    49.     }
    50.    
    51.     void OnEnable()
    52.     {
    53.     }
    54.    
    55.     void OnDisable()
    56.     {
    57.         DestroyImmediate(_baseEditor);
    58.     }
    59.  
    60.     protected override void OnHeaderGUI()
    61.     {
    62.         var method = baseEditor.GetType().GetMethod("OnHeaderGUI",  BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
    63.         method.Invoke(baseEditor, new object[0]);
    64.     }
    65.    
    66.     public override GUIContent GetPreviewTitle ()
    67.     {
    68.         if (target == null)
    69.             return null;
    70.         return baseEditor.GetPreviewTitle ();
    71.     }
    72.    
    73.     public override string GetInfoString ()
    74.     {
    75.         if (target == null)
    76.             return "";
    77.         return baseEditor.GetInfoString ();
    78.     }
    79.    
    80.     public override bool HasPreviewGUI ()
    81.     {
    82.         if (target == null)
    83.             return false;
    84.         return baseEditor.HasPreviewGUI ();
    85.     }
    86.    
    87.     public override void OnInspectorGUI ()
    88.     {
    89.         if (target == null)
    90.             return;
    91.         baseEditor.OnInspectorGUI ();
    92.     }
    93.    
    94.     public override void OnInteractivePreviewGUI (Rect r, GUIStyle background)
    95.     {
    96.         if (target == null)
    97.             return;
    98.         baseEditor.OnInteractivePreviewGUI (r, background);
    99.     }
    100.    
    101.     public override void OnPreviewGUI (Rect r, GUIStyle background)
    102.     {
    103.         if (target == null)
    104.             return;
    105.         baseEditor.OnPreviewGUI (r, background);
    106.     }
    107.    
    108.     public override void OnPreviewSettings ()
    109.     {
    110.         if (target == null)
    111.             return;
    112.         baseEditor.OnPreviewSettings ();
    113.     }
    114.    
    115.     public override Texture2D RenderStaticPreview (string assetPath, Object[] subAssets, int width, int height)
    116.     {
    117.         if (target == null)
    118.             return null;
    119.        
    120.         return baseEditor.RenderStaticPreview (assetPath, subAssets, width, height);
    121.     }
    122. }
    123.  
    124. [CustomEditor(typeof(GameObject))]
    125. [CanEditMultipleObjects]
    126. [OverrideInternalEditorTypeMark("GameObjectInspector")]
    127.  
    128. public class GameObjectEditorOverride : OverrideInternalEditor
    129. {
    130.     protected override void OnHeaderGUI()
    131.     {
    132.             base.OnHeaderGUI(); // Or some you code... Form Xamadin studio open Assembly Browser and find GameObjectInspector and there you can see how it works... also you can catch click over the Apply button just before base.OnHeaderGUI() invoked and do Event.Current.Use(). Tada!!!
    133.     }
    134. }
    135.  
    136.  
     
  12. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    Oh Thanks :)

    This solution very simple and much easier than my Thanks :)

    These keys will never be pressed again :)

    $Untitled.png

    For you as a programmer nothing changes, absolutely nothing!!!
    You can access anywhere inside prefab like now. No one line of code will be changed.

    The only thing is that you do not know about exposed properties at all :)
     
  13. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    Using OverrideInternalEditor you can mark PrefabInstance component with HideInInspector flag and render it instead of prefab buttons and nicely add all your staff into GameObject pane :)

    And also add there exposed properties and HideInInspector all subobjects of Prefab :)
     
  14. gman

    gman

    Joined:
    Jul 5, 2012
    Posts:
    24
    very impressive video. any idea on how much this will be once released?
     
  15. Cheburek

    Cheburek

    Joined:
    Jan 30, 2012
    Posts:
    382
    What I'd like to know is can you do it with components? e.g. adding component to base prefab and configuring it, would that delegate to every other object instantiating this prefab?
     
  16. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    506
    Hey, this is really cool. I got many trouble with my last project regarding nested prefabs, still yet got anything works the way I wanted. I even thought about creating something like this, but as I can see, you are doing it well :)

    Keep up the good job, man :) Thinking of some kind of support for this plugin in my Hierarchy2 :) Not anytime soon, but bookmarked :) and will absolutely do when I have some more time :)
     
  17. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Yes. Any changes on base prefab(add/remove components, gameObjects hierarchy changes...) will force all instances to delegate this changes. Also Child prefabs can alter any Parent properties/hierarchy/components...
     
    Last edited: Apr 23, 2014
  18. Mcsamuel

    Mcsamuel

    Joined:
    Apr 28, 2014
    Posts:
    2
    Hey PrefabEvolution,

    Is there an update or ETA? Has the asset been submitted or is it still in testing? Are there still bugs or features being added? Thanks.
     
    Last edited: Apr 28, 2014
  19. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Now we implement some GUI, work about obvious behaviour for end users, and writing some Manuals. So we planing submit this plugin after May/9.
     
  20. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    So i have published a new demo video that shows how this plugin can save your time.

     
  21. halfbot

    halfbot

    Joined:
    Sep 22, 2013
    Posts:
    18
    Looks great! Looking forward to this one!
     
  22. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    So right now i have submitted Prefab Evolution plugin to review. After 3-7 business day its will be available on asset store.
     
  23. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Today tested my plugin with the new GUI system introduced in Unity 4.6b. And I can say that they are completely compatible. And also work with Unity3D Free.
     
    Last edited: May 12, 2014
  24. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    68
    I need some private advice. I can't find how to PM or your email address. Can you please contact me at amitloaf at gmail?
     
  25. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Sent a message to you... So for everyone who want to contact with me mail me to prefabevolution@gmail.com
     
  26. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Bad news. Asset Sore have decline publication.

    Reason:
    So i have to write some readme.
     

    Attached Files:

  27. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Finally you can try my plugin by yourself absolutely free. See first post for details. Feel free to try it and write some review)
     
  28. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    $PerfomanceBug.png

    Full Size


    Critical Performance Bug.
    I have just 150 prefabs on scene :)
     
    Last edited: May 18, 2014
  29. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Have update link and package. So you can try it again. Test this with more than 2000 prefabs on scene.

    Recent Build
     
  30. Gang-Fang

    Gang-Fang

    Joined:
    Jan 20, 2014
    Posts:
    6
    :(still not available at asset-store?
    how much about it and will it include full source code on the paid version?
     
  31. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    If asset store review will pass successful it will appear at asset-store on this week. Source code version will be available little bit later.
     
  32. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    $SmallVisualBug.png
    Everything works fine but icon do not shown :)
     
  33. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Probably you remove it. Check that PrefabEvolution\Editor\Images\Resources\icon.png exist in your project
     
    Last edited: May 19, 2014
  34. halfbot

    halfbot

    Joined:
    Sep 22, 2013
    Posts:
    18
    Hey PrefabEvolution,
    Played around with the trial for a bit and so far it is very impressive. I will do some more testing but apart from a missing icon it seems fine.
    Great job.
     
  35. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    If you have a problem with icon, you can try to reimport PrefabEvolution. I also update package to fix it.
     
  36. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    So you can send me some feature request for this plugin)
     
  37. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    - Editor checkbox to Hide Prefab Internals in Hierarchy View
    - Edit mode in which Hierarchy displays only prefab itself and allow to modify it and save ( like if prefabs was a scene and we open it temporary through instance on current scene, edit, save and close )
     
  38. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Its really hard to implements something like this, because UnityEditor API does'n provide enough to do so.
     
  39. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    This can be done nice for Unity 4.6 :)
     
  40. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Any way its not obvious i think. if you will open a nested instance of prefab, and make some changes, when you click save/apply, what would be changed, an instance or prefab? Is this changes should be propagated to all instances or they are override instance properties. And if instance have a lot of overridden properties there is no way determine what will be applied to instance and what to prefab. Only way is to have Exposed properties, and only this properties can be overridden by prefab instance. But in some case is could be a lot of properties that should be exposed, and only way is pick all of them manually. I think this is most misleading way...
     
    Last edited: May 21, 2014
  41. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    331
    When you press open is about opening prefab through instance, so prefab will be opened and saved.

    Other logic just as it is now. If I apply some changes in some scene to prefab from prefab instance, what will be changed in tons of other scenes?
    Even more if I press apply on instance in one scene, then go to another and press apply on another instance, and so on on many scenes, I override all that instances with last on which I press apply.
    This is why we deny pressing apply on instance at all. We almost always have some properties overridden on instance so pressing apply just remove all of it, it is not what we want to do.

    The only solution to change prefab without braking instances is:
    - focus project view
    - select instance A and press select to highlight prefab in project view
    - go to project view
    - drag prefab from it to scene
    - move new instance under instance A parent
    - make changes to new instance
    - press apply on new instance
    - remove new instance from scene

    I think many people very familiar with these steps

    Opening prefab just encapsulates all of it to:
    - select instance A and press open to open prefab
    - make changes to prefab
    - press save and close

    Exposed properties is good idea too ( encapsulation is always good idea ), but we can leave without it now.
     
  42. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Finally! Prefab Evolution plugin available on Asset Store!
     
  43. vidjo

    vidjo

    Joined:
    Sep 8, 2013
    Posts:
    97
    No source codes? Makes me hesitant to spend the money. One little change in Unity from a new update could break the whole asset. Or maybe an unforseen bug. I'd like the peace of mind to know I can go in and make changes. Or maybe I want to automate your asset from my own editor scripts. Please consider releasing source.
     
  44. Mcsamuel

    Mcsamuel

    Joined:
    Apr 28, 2014
    Posts:
    2
    Congrats on the release! :)

    I agree with vidjo, I already paid the $50 but would really feel better if the source was included. I want to make some small changes to how the asset operates but have to request and wait. This is not the end of the world is definitely inconvenient.

    Can you please allow the asset to be in other folders. I tend to move my assets to a sub folder i.e. not in root Assets folder. Thanks.
     
  45. vidjo

    vidjo

    Joined:
    Sep 8, 2013
    Posts:
    97
    Yeah, honestly I'd pay twice as much for source code. Youd definitely get a shining review from me :)
     
  46. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225


    I really planing to include sources to this package. But probably not now. If you have a problem with this package feel free to send Bug Reports or Feature Requests to me on mail or to this topic. And I will try to fix all bug as fast as it possible.


    You can move it to any folder.
     
  47. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    94
    I agree with vidjo 100%
    Ive had trouble with closed source in the past and I am very hesitant to start using it as an integral part of my workflow if I dont have the source code. This is not just something the project can live without. One little bug could be a showstopper causing us huge time and money losses.
    And trusting in your customer service is not something I can do lightely.
     
    AdmiralThrawn likes this.
  48. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    You are probably a developer, and you probably know that customer support is not easy deal. But for now is more inconvenient to support that is can be changed by 3rd party developer. Now if someone send me bug report i can be sure that is my mistake, and i can find it much faster, fix and send recent fixed build of the package. Little bit later i will put all sources right inside this package and all customers after update will get it. But now i'd like to be sure that some my customer can change sources a bit, make a bug and send me a bug report. Be sure that this plugin its will became open source.
     
    Last edited: May 23, 2014
  49. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    348
    Imagine a magical world where you can import this asset without getting any errors.
    I get a popup telling me that my project does not support Prefab Evolution and I have to click ok about a hundred times and this with every asset I install.
     
  50. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Free version of plugin support projects with less than 1000 assets.