Search Unity

Prefab Evolution Plugin(nested prefabs)

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

  1. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    While plugin is pending for review everyone who would like to get it right now just mail me on prefabevolution@gmail.com
     
  2. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    Thank you for the quick fix.
     
  3. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Any time:)

    Also guys who would like to get most recent updates, and don't like to wait while fixed version waiting for Asset Store review, can send me a mail to prefabevolution@gmail.com with topic "PrefabEvolution ORxxxxxxxxx" where ORxxxxxxxxx is your invoce ID. And will send you back most recent updates.

    And i will be very happy i you can write a review about this plugin on the Asset Store :)
     
  4. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Version with fixes for Unity 4.6.1 now available on Asset Store.
     
  5. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    New version would be avaliable on the Asset Store soon!
    This version contans fixes about loosing references on outer objects from components that not exists on parent prefab.
    If you want to get new version right now, just send me a mail to prefabevolution@gmail.com with topic "PrefabEvolution ORxxxxxxxxx" where ORxxxxxxxxx is your invoce ID.
     
  6. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Christmas sale starting right now! Now its only 25$! Hurry up!
     
  7. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Can I ask if Prefab Evolution will help in this circumstance?

    The 3d artist creates the mesh of a building, and the level designer change the building into a prefab and attaches script to different game-objects in side the building prefab. Then the 3d artist comes up with a new mesh for the building.

    Can Prefab Evolution helps to replace the mesh in prefab without losing all the scripts attached to the sub gameobjects in side the building?
     
  8. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Yes you can nest/inherit models just like normal prefabs. When Unity editor detects model reimport, plugin will update all nested instances.
     
  9. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Thanks for the quick reply. I would like to clarify the question

    What if the level designer attaches script to sub-mesh inside the mesh, and the mesh is re-imported. Will Prefab Evolution preserve the scripts attached to the sub-mesh.
     
  10. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Yes. Any changes on prefab, attaching/deleting components, changing properties, change parent, reorder transforms, will be safe after model reimport. But all your bones in model should have unique names. Then plugin can proper identify objects and apply changes on it.
     
  11. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Thanks! You've just sold the prefab on me.
     
  12. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi again. The Asset Store released new feature for asset publishers. Now publishers can create vouchers and give them as gift to anyone. So now, if you want this plugin but don't wanna pay - its your chance.
    As you can see my pligin have little bit ugly pictures on the Asset Store. So i would like to spend some vouchers to updatee this content. So if you are have an artist skills and want to get this plugin, just contact with me by email prefabevolution@gmail.com ;-)
     
  13. Mono96

    Mono96

    Joined:
    Jan 7, 2015
    Posts:
    1
    When will the christmas sale end?
     
  14. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    On the next week
     
  15. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Hi, your asset causing an error at me. When I click on Apply at an instance of a specific prefab (that is not inherited by another prefab) it throws:
    Though, everything seems to work.

    I was playing around and it seems I cannot reproduce it. It only happens on instances of this one and only prefab. When I create a new prefab from the game object and instantiate it again, the error won't get thrown again. The problem exists in the .prefab file. I could solve it by creating the new prefab and overriding the new meta file with the old, but this will reset all my instance game object transform positions.

    I've then backup'ed everything in my SVN and started to remove my components in the instance object and tried to apply, component by component and script by script to determine where the error was coming from. I found one of my scripts, out-commented everything step by step and the exception stopped to be thrown when I removed:
    Code (CSharp):
    1. public string[] groups = default(string[]);
    Other scripts of the affected game object are using string arrays the same way. Also I've tested when this exactly appear and the truth is, it does in any state my array has (empty, larger size but all empty fields, partially filled fields, complete filled fields), but only on instances of the this one and only prefab, as already told.

    Now this is kinda annoying, as the exception will be thrown forever on this prefab instances. It would be great to find a way to get rid of this message, but ignoring it is no option for me.
     
  16. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    So maybe you can try to remove reduant field initialization. default(string[]) == null, and this is same as public string[] groups;
    Also what version of Unity you are use?
     
    Last edited: Jan 12, 2015
  17. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    4.6.1p2, but when checking it out now, no error is thrown, everything fine again, it's weird.
    Btw, I rather use this redundant initialization as it's a part of a code snippet that has to work with all types, obviously.

    Well I like your work, it's nice. Keep going that work.
     
  18. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Sry for double post, but now I got another problem that drives me crazy. I got a game object with some scripts and components. When I was done configure them I created 2 childs from them, in both childs I added a particle system for each. Now when I change the parent prefab and press apply, it will pass the new settings of my components and scripts to my childs, but on the 2nd child it removes the particle system. This problem persists.

    The first child that keeps my particle system (as I want it) but it throws an exception:
    Code (csharp):
    1. CheckConsistency: GameObject does not reference component MonoBehaviour. Fixing.
    2. UnityEditor.PrefabUtility:ReplacePrefab(GameObject, Object, ReplacePrefabOptions)
    3. PrefabEvolution.PEPrefabScriptExt:ApplyChanges(PEPrefabScript, Boolean) (at Assets/PrefabEvolution/Sources/Editor/PEPrefabScriptExt.cs:382)
    4. PrefabEvolution.PEPrefabScriptExt:ApplyChanges(PEPrefabScript, Boolean) (at Assets/PrefabEvolution/Sources/Editor/PEPrefabScriptExt.cs:442)
    5. PrefabEvolution.PEUtils:DoApply(PEPrefabScript) (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:382)
    6. PrefabEvolution.PEGameObjectInspectorOverride:Apply(GameObject) (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:161)
    7. PrefabEvolution.PEGameObjectInspectorOverride:Apply(GameObject[]) (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:176)
    8. PrefabEvolution.PEGameObjectInspectorOverride:Apply() (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:146)
    9. PrefabEvolution.PEGameObjectInspectorOverride:OnHeaderGUI() (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:99)
    10. UnityEditor.DockArea:OnGUI()
    11.  

    On a second test with a new game object and two childs it removes added components on the childs when pressing apply on the parent. Is this effect desired? Because this is not how inheritance should work, I should be able to extend children and still be able to modify base components and children on the parent and apply them to all my children without removing the extended components or scripts on the children.

    If this is not desired, there need anything to be done. But right now it looks like it tried to remove the particle system from my first child in my first example, too. But it failed with an exception.

    What's going on here?
     
  19. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    I check this out. But inheritance is should work as well. I have auto tests that cover this case. And i try to reproduce that, but not see any problems. Can you make some test project where this bug exists?
     
  20. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Okay so, in my current game I created a parent prefab from a game object, added a SpriteRenderer with a 1px sprite and a color over it. Then I created two childs with PrefabEvolution and added a ParticleSystem to both children. I copied my whole game, tested the bug on the main project, it persists.

    So on my copied version of my game, I removed all game related stuff. So all that is left are 3 prefabs (the father and its sisters), 1 sprite, UnityVS, PrefabEvolution and one almost empty scene.

    Download https://dl.dropboxusercontent.com/u/55589036/zzzOther/PrefabEvolutionTest.zip and extract it anywhere. Open the scene Main.unity in "Assets\Scenes". When opened, check the two children of the TestParent prefab, there are ParticleSystems on it. Go to the parent prefab and change the overlay color of the SpriteRenderer, then press Apply on the parent. Now navigate to any child and the ParticleSystem should be away.

    If this does not happen, maybe you gonna try it with Unity 4.6.1p2 (the version I use)?


    Please tell me when you have downloaded it, so I can remove it from my cloud again.
     
    Last edited: Jan 20, 2015
  21. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Downloaded.
    So as i understand you are add this particle system to prefab itself, but not to the instance on scene? Did you click apply after that? If so... Its not a bug or so on. Its just system requirement. After you click apply the magic happens. Nested prefabs just a script that save information about prefabs, after you click apply its compare and search for the differences with its parent. And if you change its parent and click apply, its replace every instance and apply all diffs that was determined before(honestly its bit more complicated than just replace. its recovers objects that added, remove destroyed objects, replace references on related objects from old objects to new one and so on. Formaly its should cover every your need when you working with nesting and inheritance.) But if you don't click apply on prefab after you change it, you will have some trouble, because changed child prefab in your case have no information about new components, and its can't recover them.
    To fix this behaviour i should calculate diffs very often and this will take too long time. Unity engine doesn't provide any events that throws when the object changed(except OnValidate that invokes very often).
    Just don't forget to click Apply:)
    Feel free to send me a bug reports)
     
  22. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Of course, I pressed Apply when doing any changes, always. However, I was always editing the prefabs, not its instances. And I prefer to do it this way and based on what you are saying, this should work.

    So did you test it? You can try to click Apply on both childs on my sample, first. The bug should stay.
     
  23. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    Hi! I have an fbx and I want my prefab to update whenever my modeler/animator updates the fbx. Can you give simple steps to do this? I watched the video but it kinda skipped how you setup your prefab for your fbx. Thanks!

    EDIT: I figured it out. For some reason, it is not setting my fbx into a nested prefab when I first imported the plugin. But it is working now.
     
    Last edited: Jan 27, 2015
  24. KalebGraceTwistory

    KalebGraceTwistory

    Joined:
    Mar 6, 2014
    Posts:
    3
    Hello! I love this plugin! I purchased it both at home and at work. I did notice a small bug though. This has to do with AnimationCurves. If an AnimationCurve is in a serialized class, its default value will always be null. When the comparison runs, this will cause a null reference exception. I rewrote the following function and it seems to work fine now. (Sorry for the lack of indentation. Can't seem to paste that in here.)

    Code (CSharp):
    1.  
    2. static internal bool Compare(AnimationCurve c0, AnimationCurve c1) {
    3.   if (c0 == null && c1 != null) {
    4.   return false;
    5.   }
    6.   if (c0 != null && c1 == null) {
    7.   return false;
    8.   }
    9.   if (c0 != null && c1 != null) {
    10.   if (c0.postWrapMode != c1.postWrapMode) {
    11.   return false;
    12.   }
    13.   if (c0.preWrapMode != c1.preWrapMode) {
    14.   return false;
    15.   }
    16.   if (c0.keys == null && c1.keys != null) {
    17.   return false;
    18.   }
    19.   if (c0.keys != null && c1.keys == null) {
    20.   return false;
    21.   }
    22.   if (c0.keys != null && c1.keys != null) {
    23.   if (c0.keys.Length != c1.keys.Length) {
    24.   return false;
    25.   }
    26.   for (var i = 0; i < c0.keys.Length; i++) {
    27.   if (!Compare(c0.keys, c1.keys)) {
    28.   return false;
    29.   }
    30.   }
    31.   }
    32.   }
    33.   return true;
    34. }
    35.  
     
    Last edited: Feb 3, 2015
  25. liyong79623

    liyong79623

    Joined:
    Feb 2, 2015
    Posts:
    14
    Need Support for Windows 81 and Store Porting.
    When I build for WinRT, Many Errors are reporte from PE's code, which use many reflection API. WinRT has move many Reflection away.
    So in my opinion, PE is a editor tool, why so many code in run-time ? Can you support WinRT (windows phone and store app).
     
  26. BIMG

    BIMG

    Joined:
    Oct 1, 2014
    Posts:
    16
    Hello,
    I got this error in latest U5.

    modifications.empty()
    System.Reflection.MethodBase:Invoke(Object, Object[])
    PrefabEvolution.PEOverrideInternalEditor:OnSceneDrag(SceneView) (at Assets/Scripts/ThirdParty/PrefabEvolution/Sources/Editor/PEOverrideInternalEditor.cs:86)
    UnityEditor.DockArea:OnGUI()

    modifications.empty()
    UnityEditorInternal.InternalEditorUtility:HierarchyWindowDrag(HierarchyProperty, Boolean, HierarchyDropMode)
    UnityEditor.DockArea:OnGUI()

    Do you have some fix for this case?

    Thanks for support.
     
  27. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    +1 for windows store, reflection api fixes
     
  28. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Today new version of the plugin is submited to the Asset Store. While plugin in review you can got all this changes right now. Just mail me prefavevolution@gmail.com.

    Changes:
    - Windows Phone reflection api fixes.
    - Fixed AnimationCurve compare NPE
    - Unity 5 Support
     
  29. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
    Seems to work well on Unity 5 so far :) Workflow related question: we recently started ramping up production and entered into a bit of asset management hell, hence the purchase of your asset. Our game is made primarily of two scene types:
    1. Main Menu
    2. Levels
    Things change often, so in our level scenes we like to use an "Essentials" prefab that acts as a sort of container for all the other stuff in the scene.


    This makes it easy to propagate universal changes across all scenes. If I want to change "Enemy" to "Enemy1" I can do that and hit apply and voila!


    The issue as you know comes at merge time -> Unity only sees the change in the parent "Essentials" game object. I thought your asset would help with this problem, however...


    ...hitting apply on the parent turns the nested prefab into it's own unique instance, causing the same problem as before: Unity only sees the changes in the parent on merge. So...


    Am I correct in assuming that the workflow should be like this instead, where we should only be making the changes to the original prefab by either dragging it into the scene and making the change or remembering to only make changes to the prefab, NOT the instance? This works like we want, but seems a little convoluted and leaves room for user error. I realize this is maybe not exactly the use case you had in mind when designing this thing, so are we doing it wrong? Reading back through the thread again I saw this post:

    I got a little lost in Jes28's explanation, but I think we're talking about something similar. Sorry for the length of this post :) My main question is this: would it be desirable / possible for nested prefabs to be NOT be instanced? Thanks!
     
  30. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    As i understand, you are need the way to apply changes to prefab from its instance? If so, now i working on this case allready. And you will see this in next release.
     
  31. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
    Looking forward to it, really great asset :)

    EDIT: Just to clarify my exact use case...

    Say for example we have two people working on a single scene, one person changes the "Enemy" and the other person changes the "Player".
    1. First part is correct, we'd want some way to be able to change those prefabs from the instance to the main prefab. That way we can see it updated appropriately in all other scenes. Would it be possible to allow the user to select whether they want the element in the hierarchy to represent the "Instance" or the "Prefab"? If not, then just adding some "apply to main prefab" option would be ok.
    2. Normally all you would see is a merge conflict on the top parent "SceneManager". If one person changes "Enemy" and another person changes "Player", is it possible to apply those changes in a way that doesn't affect the parent "SceneManager"? If not, as long as the merge shows all three and the change can be properly merged, that's fine :)
     
    Last edited: Mar 7, 2015
  32. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Hi!

    Stumbled on an error while working with fbx: newly imported fbx have the Evolve Prefab component automatically added, but old ones need a modification in order to get it.
    The issue happens when Applying changes on a fbx file with the Evolve Prefab component on it. I'll just change some random value and reset it, and it gives me the following error:

    MissingReferenceException: The object of type 'EvolvePrefab' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    PrefabEvolution.PEExposedPropertiesEditor.DrawLock (Rect rect) (at Assets/Plugins/Editor/PrefabEvolution/Sources/Editor/PropertyExposure/PEExposedPropertiesEditor.cs:54)
    PrefabEvolution.PEExposedPropertiesEditor.Draw () (at Assets/Plugins/Editor/PrefabEvolution/Sources/Editor/PropertyExposure/PEExposedPropertiesEditor.cs:121)
    PrefabEvolution.PEGameObjectInspectorOverride.OnInspectorGUI () (at Assets/Plugins/Editor/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:139)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)
    UnityEditor.DockArea:OnGUI()

    MissingReferenceException: The object of type 'EvolvePrefab' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEditor.Editor.IsEnabled () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:530)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1072)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:959)
    UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:340)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    Those errors are prompted in console about 6 times (always those two), the inspector goes blank, and I have to select another file and come back on the fbx to see it unchanged.
     
  33. VacuumBreather

    VacuumBreather

    Joined:
    Oct 30, 2013
    Posts:
    68
    Hey there, thinking about purchasing this. What's the state of this asset with Unity 5? Is it fully compatible, also regarding the Unity API changes? And does it work well together with assets like "AdvancedInspector"?
     
  34. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Last version is fully compatible with Unity 5. Also if Advanced Inspector work well with normal prefabs then its will work with Prefab Evolution.
     
    VacuumBreather likes this.
  35. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    How can you remove a parent from a prefab?
    I don't want to replace it, I want to remove it so the child is no longer a "child".

    Thanks.
    -- Paul

    P.S. Sorry if this is a stupid question, or has been answered, but I'm running out the door for work.
     
  36. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Where can I check in the PE files to know what version I have installed?

    Thanks.

    -- Paul
     
  37. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    I think I'm missing something simple... I'm using PrefabEvolution to manage prefabs of UI controls with the goal of being able to make changes to the prefab and then push those changes out to all the instances. For example: I change the selection color of my input field prefab, and then I want to set all instances to use that selection color.

    I can go into each instance and select to apply the change, but that doesn't save any time.

    Any advice?
     
  38. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Also, I keep getting this exception in the editor when I update a prefab running 5.0.0f4:

    ArgumentException: Getting control 0's position in a group with only 0 controls when doing mouseUp
    Aborting
    UnityEngine.GUILayoutGroup.GetNext ()
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
    UnityEngine.GUILayoutUtility.GetRect (Single width, Single height)
    UnityEditor.GameObjectInspector.OnHeaderGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:135)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    PrefabEvolution.PEOverrideInternalEditor.OnHeaderGUI () (at Assets/PrefabEvolution/Sources/Editor/PEOverrideInternalEditor.cs:95)
    PrefabEvolution.PEGameObjectInspectorOverride.OnHeaderGUI () (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:88)

    UnityEditor.Editor.DrawHeader () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:352)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1034)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:959)
    UnityEditor.InspectorWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:340)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


    Has anyone else seen this with 5.0.0f4?
     
  39. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Check that on the same version and I don`t see any exceptions. Can you provide some example project or steps how i can reproduce it.
     
  40. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Example:
    Make a input field prefab and convert it to nested prefab. Nest this prefab into many others prefabs. Now you have main input field prefab and many prefab instances nested inside other prefabs. Now if you would like to change some common property and apply this changes to all other instances you should put your main InputField prefab to the scene(or just select it in project tab), made you changes(change selection color to red) and click apply. All nested instances should get this changes. If change selection color to green in one nested prefab instance, you will override this property only for this instance. This means that if you change this property on main prefab this instance will keep its selection color green.
     
  41. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    I'm working to reproduce the former error in a project for you, but it only happens occasionally.

    Is this warning when selecting "Apply" in a green cube normal?

    Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
    UnityEngine.Transform:set_parent(Transform)
    PrefabEvolution.PEUtils:SetParentAndSaveLocalTransform(Transform, Transform) (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:92)
    PrefabEvolution.PEPrefabScriptExt:ReplaceInPlace(PEPrefabScript, GameObject, Boolean, Boolean) (at Assets/PrefabEvolution/Sources/Editor/PEPrefabScriptExt.cs:67)
    PrefabEvolution.PEPrefabScriptExt:ApplyChanges(PEPrefabScript, Boolean) (at Assets/PrefabEvolution/Sources/Editor/PEPrefabScriptExt.cs:405)
    PrefabEvolution.PEUtils:DoApply(PEPrefabScript) (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:382)
    PrefabEvolution.PEUtils:Apply(Object) (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:374)
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
     
  42. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi, is this tool able to do that what Merlin's Prefab Lab can do. Merlin's Prefab Lab seems to be not updated frequently, im not sure that it still works. My problem is, that i often update the model, which then looks screewed up in the prefab. Simple model modification works fine, but if i paranting somewhat, change bones and so on, Unity algorithm fails to merge it. In this case i copy and delete the objects in the model by hand, or i recreate the prefab with scripts and additional GameObject's (added to the model, like particle effects to an empty GameObject).
     
  43. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Yes this plugin can help in your case. You can nest models inside prefabs create prefabs that inherited from your models. This plugin will remember all changes that you mede before and apply all this changes to all nested or inherited instances of this model. There is only one restriction: your bones should have unique names. But only that bones that important. So if you have model with two hands and you would like to add some extra components on it, you have to name them well, so plugin can determine them. If you rename than nodes all changes made over that node will be lost.
     
  44. WillGood

    WillGood

    Joined:
    Apr 15, 2015
    Posts:
    1
    I was looking to solve one problem. We have one huge scene, and when we have two artists working on the same scene, it becomes very difficult to merge their changes together. Because prefabs are saved out to their own files, I was hoping to break our scenes out into a lot of different prefabs, each with a lot of their own child prefabs, that way different artists can work on different parts of the scene, and only change the prefab they are working on (and thus, no conflicts when merging).

    The problem I am seeing, is that when i make a change to my child prefab, and then apply that change, the change actually goes out to each parent prefab file, and then I have to submit my child prefab as well as my parent prefab (even though I haven't ACTUALLY made a change to my prefab).

    I can totally understand why it works like this, so i don't fault the design, but for my case, it clearly doesn't work. Is there a way to avoid this issue?
     
  45. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    304
    I'm having trouble understanding how this works.

    I'm trying to set up my game so that I can edit the same object from multiple scenes. Some objects, like my Main Camera and Canvas, are set to DontDestroyOnLoad, and they're only instantiated in the first scene. When creating a second scene, I can't simply assign new objects to an instance of my Camera; those references will be lost because the player will reach the second scene with the Camera that was instantiated in the first scene.

    To fix this, it seems like I have to make references to the prefab itself.

    For one, I don't know how this would work for all objects, since objects in the hierarchy can't be assigned to a prefab.

    Two, even just between my DontDestroyOnLoad objects, I can't assign all of the references to the prefabs because only one child is visible.

    For example, let's say I want to assign Config Button to a public variable in a script attached to Main Camera. Here is a screenshot from my hierarchy:


    And here is a screenshot from my assets folder:


    The children of Pause are not visible, so I can only assign variables to Main Camera through the instance in my hierarchy. Of course, these references would be lost if I were to make them to the instance in my second scene and then load the game from my first scene.

    How do I solve this?
     
  46. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Unity 5 provide some nice feature, that can be useful for you: "Prefab instance objects are no longer stored as part of the scene file." This mean that scene now will save only prefab property overrides and expose only objects that have references from the outside. You can just split your scene to many prefabs and edit them separately. Also Unity 5 have "Command line merge tool that understands the scene and prefab formats in order to do semantic merges." that can help you a lot.
     
  47. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. I see 3 ways to do that:
    3. Use FindObjectOfType/FindObjectByTag to build references between objects.
    2. Use Singleton pattern
    1. Use DI/IoC frameworks to inject dependencies to your prefabs an scenes. You can find some frameworks for Unity on the Asset Store:
    https://www.assetstore.unity3d.com/en/#!/content/9267
    https://www.assetstore.unity3d.com/en/#!/content/25562
    https://www.assetstore.unity3d.com/en/#!/content/32157
    https://www.assetstore.unity3d.com/en/#!/content/17758
     
  48. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    304
    Could you elaborate on that? I've tried reading about the first two methods but I don't see how they would specifically solve the problem of not being able to nest prefabs and/or referencing prefabs from multiple scenes.
     
  49. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @PrefabEvolution : I've publish the common solution for preventing icon overlapping for all third party extensions, maybe you can have a look and consider support it for the next update. Not only just icon overlapping but some other features as well, should not take you more than 5 minutes to integrate, so here is the link :

    http://forum.unity3d.com/threads/hierarchydraw-put-your-hierarchy-icons-under-control.319039/

    I already support HierarchyDraw in my beta versions for Hierarchy2. Hopefully you will do it next ! :)

    Thanks.
     
  50. Mr Asset

    Mr Asset

    Joined:
    Sep 9, 2014
    Posts:
    4
    We're using Prefab Evolution for a project, and it works great once we figured out how it worked :)

    But, we've run across a bug that makes it hard to use: It seems like if you change a custom script in an inherited prefab it won't be picked up as a modification, and will be overridden if the parent/super prefab has its script changed (and by other changes). For example:

    BasePopup has a custom script component called BasePopup.cs.
    SpecializedPopup inherits from BasePopup, but changes the script to SpecializedPopup.cs, but this is not recorded in the Modifications of the popup.
     
    super77gg likes this.