Search Unity

Prefab Evolution Plugin(nested prefabs)

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

  1. jice

    jice

    Joined:
    Jan 7, 2014
    Posts:
    2
    it seem there is some problems with new uGui's ScrollRect component and your plugin (4.6b17)
    i have error logged in console when there is refresh after i apply on a prefab which have this component (not reproducible at 100% but it's very very frequent)
    and this error can make scene unusable (no more seeing my UI), only solution at this state is close and re-open unity (close and re-open scene don't work)

    here is call stack:
    ---
    MissingReferenceException: The object of type 'ScrollRect' 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.
    UnityEngine.Component.get_transform ()
    UnityEngine.UI.ScrollRect.UnityEngine.UI.ICanvasElement.get_transform ()
    UnityEngine.UI.CanvasUpdateRegistry.SortLayoutList (ICanvasElement x, ICanvasElement y) (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/CanvasUpdateRegistry.cs:111)
    System.Array.qsort[ICanvasElement] (UnityEngine.UI.ICanvasElement[] array, Int32 low0, Int32 high0, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1772)
    System.Array.Sort[ICanvasElement] (UnityEngine.UI.ICanvasElement[] array, Int32 length, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1699)
    Rethrow as InvalidOperationException: Comparison threw an exception.
    System.Array.Sort[ICanvasElement] (UnityEngine.UI.ICanvasElement[] array, Int32 length, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1702)
    System.Collections.Generic.List`1[UnityEngine.UI.ICanvasElement].Sort (System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:579)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/CanvasUpdateRegistry.cs:62)
    UnityEngine.Canvas.SendWillRenderCanvases ()
    UnityEngine.Canvas.ForceUpdateCanvases ()
    UnityEngine.UI.ScrollRect.OnEnable () (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/ScrollRect.cs:129)
    UnityEditor.AssetDatabase:SaveAssets()
    PrefabEvolution.PEUtils:DoAutoSave() (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:376)
    PrefabEvolution.PEUtils:DoApply(PEPrefabScript) (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:369)
    PrefabEvolution.PEGameObjectInspectorOverride:Apply(GameObject) (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:151)
    PrefabEvolution.PEGameObjectInspectorOverride:Apply(GameObject[]) (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:166)
    PrefabEvolution.PEGameObjectInspectorOverride:Apply() (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:136)
    PrefabEvolution.PEGameObjectInspectorOverride:OnHeaderGUI() (at Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:84)
    UnityEditor.DockArea:OnGUI()
    ---
     
  2. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Its looks like uGUI doesn't check that the component is destroyed. You probably should send this call stack to UT. As for now you can disable "Preferences => Prefab Evolution => Auto Save".
     
  3. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    24 Hours deal on Asset Store! Only 25$ for Prefab Evolution plugin! Hurry up! :)
     
  4. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    Hi. I was always planing to buy your amazing looking addon and today I saw the deal and I jumped on it :)

    My tests are ok so far.
    I have a question... I have my own gameobject inspector class and I saw that you also implemented your own gameobject inspector. I don't want to modify your or my version of it. Is there a way to make them work together ?
     
  5. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Hi
    I am new to Unity, I don't quite really get it how this will benefit me.
    I have watched your videos, but still can't figure out what it does apart from creating prefabs from prefabs and connecting it together, so if one is modified, rest of them will be modified too.
    Can you please expand on technicality of this asset and the benefits it will bring?
     
  6. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    You can't have a prefab existing of prefabs in Unity. This asset allows for that.

    So you can have multiple enemies use the same gun, where the enemies are prefabs, containing the gun as a prefab. Now without this asset, if you want to change the gun, you'll have to change it on every enemy prefab you have.

    With
    this asset, you can change the gun and have those changes be applied to all enemies with that gun.
     
  7. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Thank you for the clarification. I will look into it.
     
  8. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    You can contact with me by mail(prefabevolution@gmail.com), and may be we can solve this together:)
     
  9. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    As OnePxl said this plugin can nest your prefabs and save your time when you working with prefabs. Its also can make inherited prefabs. For example you can have BaseDialog prefab with some skin and layout, and inherit all other dialogs from it. If you would like to change skin or layout globally for all assets, without this plugin, you should open every prefab and manually change all this settings, with this plugin you just open BaseDialog prefab change it and click Apply. All inherited prefabs and all instances of BasePrefab dialog will be changed. Also this plugin allows you to override any property of the prefab instance or inherited prefabs. For example you can change any property of the child or inherited prefabs and this property will be marked as overridden, and if you change root prefab all changes except overridden will be applied. More over you can add/remove any component or gameObject even you can change hierarchy of the prefab instance/child and all this changes will be handled proper.
    In our projects we are widely use this plugin for making GUI, with gameObject based GUI system(like nGUI).
    This plugin also can help you with your models. So this is very common case when your artist make some models and after that you make some extra changes on it(add some extra components, gameObjects and so on), and you have to make a prefab form it. And when your artist would like to change model you will have to remember all changes that you done before and do all this work again, and again, and again, with very high error prone... This is very sad and annoying. But this plugin allows you to make nested models, or even create inherited prefab from it. In this case all instances will be changed every time when you make any changes to your model and automatically will apply all extra settings to your model. And its helps you to focus on really important things and be DRY :)
     
    Last edited: Sep 19, 2014
  10. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    Hi. I sent you an email few days ago but didn't hear back yet :) :)
     
  11. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Sorry for that) Check your mail)
     
  12. TirythDM

    TirythDM

    Joined:
    Dec 17, 2012
    Posts:
    3
    Hi, I has imported your prefabevolution, but I'm get some error

    The type or namespace name `ISerializationCallbackReceiver' could not be found. Are you missing a using directive or an assembly reference?

    I dont know what it is o.o
     
  13. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    Last edited: Sep 24, 2014
  14. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    is there any way to apply changes to nested child prefabs through a nested parent prefab ??

    the parent is also child of something else if that makes any difference
    group prefab holds the parent and its two child prefabs

    I thinks its because the child prefabs points to the unnested version of the prefab
    how do I make the nested and unnested versions the same
    ---edit just tried creating child prefabs from nested version, they worked like they should until I apply the group prefab and there icons changed to indicate they are nested

    also is there a way to disable auto-clasping modifications foldout
     
    Last edited: Sep 26, 2014
  15. AniMoney

    AniMoney

    Joined:
    Sep 28, 2014
    Posts:
    10
    Hey this plugin looks really useful. Very similar to how Flash handles it's symbols. I always felt unity should work the same way.

    I was wondering if you were planning a sale anytime soon? I'm interested in the plugin but can't justify buying it at the moment. I know it's cheeky to ask, but I'll probably buy it when I have the money anyways! :p
     
  16. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Changing nested child through nested parent will probably have large error prone, because its not really obvious changing some contextual properties. When i develop this plugin i think "Safety first!", and i decide to disable any feature that can probably destroy your assets. So this thing is very dangerous, just like normal prefabs in unity:). For example normal prefabs on the scene contains overridden properties and if you apply all prefabs on the scene you will lost all overridden properties of the prefabs. In this case will be same thing, when you apply changes to nested instance all overridden properties will be lost, because there is no way to compare this prefabs. For example if you create button prefab and put it inside dialog prefab, obviously you will reuse this button in many other places. And every instance will have own overridden properties(position, color, label text) this properties are diffs between current instance and prefab asset. So if you have the way to apply changes through nested instance this instance will lost all overridden properties, and this properties was changed by context(dialog) and should not be applied to another instance. All changes that should be applied to prefab and all nested instance should be applied to prefab. All changes that should be applied to nested instance, should be applied to nested instance. And only this way is safe and solid. But any way this topic is open to discuss, and if you have some thoughts about this i'd like to hear them.
     
    Last edited: Sep 28, 2014
  17. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    Thank you for the explanation,
    I understand

    I value inheritance more because I'm used to setting "keep" and "ignore" values on child prefabs

    Could I have the option to "keep" active inheritance on nested prefab?
    This way the safe default behavior is still in place, but users have the option to continue using inheritance if they choose.
     
  18. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    I don't really understand that, can you explain this lil more?
     
  19. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    For example,

    Say I take the button that was nested in the dialog prefab, and make a child of that nested prefab.
    now I say this nested parent button has a specific style that is consistent for all its child prefabs

    now I can have multiple styles for the same top level button parent prefab
    (1 : 2 : 3, 1 --> 2 --> 3)

    Top level Parent button prefab --> child button prefab and parent prefab for style --> child style button prefab, context specific

    no instances --> one nested instance in each dialog defining style --> one or more nested instances in each dialog defining context

    no instances --> user set option to apply to prefab, instances and child prefabs --> default option only applies to nested instances
     
  20. Photonic4140412

    Photonic4140412

    Joined:
    Apr 23, 2013
    Posts:
    3
    Scale in general does not seem to be working on nested prefabs. The only way I can get it to pull the scale from it's parent is to manually go into all of the nested versions and click on the "revert" button for the scale value.

    Is this a bug, or is there a work around?
     
  21. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Yeah. I know about this bug and will publish fixed version on next week. So if its really critical for you you can mail me on prefabevolution@gmail.com and i will send you a patch...
     
  22. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Now Prefab Evolution plugin only for 35$!
     
  23. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    What are the fixes you made in the latest release?
     
  24. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    1. fixed bug with scale/rotation properties of the instance root
    2. now you can convert many prefabs to nested with one click.
     
  25. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi everybody! Currently on Asset Store my plugin have 5 start and i very happy that you found its very useful. But i think that we can make it better. How we can? I propose to discuss what you would like to see and what you would like to improve. I will be glad to fulfill all your wildest desires.
    And welcome any feedback on the Asset Store :).
     
  26. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    Inspector buttons should be smaller :)

    And I would like to have the option of working with context (right click) menus instead of modified gameobject inspector. Maybe a setting for disabling the modified gameobject inspector...
     
  27. AniMoney

    AniMoney

    Joined:
    Sep 28, 2014
    Posts:
    10
    Hey that's awesome that it's $35 now! I will probably buy it next weekend. :)

    Is there still a trial available? I would just like to make sure it works for what I need. If not it's ok I will likely buy it anyways.
     
  28. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Sorry, but demo version is not available now. I need do some extra work to recently update it. So if you have some questions about plugin just ask. And we can said is this plugin right for your needs)
     
    AniMoney likes this.
  29. Sord

    Sord

    Joined:
    Jan 13, 2014
    Posts:
    10
    Hi

    I have problem with PrefabEvolution and Unity 4.6. I have newest PE and problem has been at least with unity builds 20 and 21 (and maybe older too).
    I add ui prefab B inside ui prefab A (both nested already) and change prefab B position and apply those changes to A, it works nice so far but if apply any changes to B later it will mess location of B inside A.

    There is simple test scenario.
    To replicate: simply choose Image prefab from Assets folder and click apply, position will be change.
     

    Attached Files:

  30. AniMoney

    AniMoney

    Joined:
    Sep 28, 2014
    Posts:
    10
    I went ahead and bought it! I'll let you know if I have any issues. :)
     
  31. bobmoff

    bobmoff

    Joined:
    Sep 23, 2014
    Posts:
    44
    I am using 4.6.0b20 and just installed your plugin and as soon I click "Apply" on a nested prefab I get this:

    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 ()
    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 /Users/bobmoff/Dropbox/IMGNRY/wars/dev/unity/Assets/PrefabEvolution/Sources/Editor/PEOverrideInternalEditor.cs:95)
    PrefabEvolution.PEGameObjectInspectorOverride.OnHeaderGUI () (at /Users/bobmoff/Dropbox/IMGNRY/wars/dev/unity/Assets/PrefabEvolution/Sources/Editor/PEGameObjectInspectorOverride.cs:88)
    UnityEditor.Editor.DrawHeader ()
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors)
    UnityEditor.InspectorWindow.OnGUI ()
    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)
     
  32. LarsRocks

    LarsRocks

    Joined:
    Oct 23, 2014
    Posts:
    10
    @bobmoff: if you read the documentation, you'll notice that 'Apply' is forbidden on nested prefabs.
    Page 3:
    Also nested prefab instances can't apply changes to theirs prefabs.​

    For me (4.6b17) the Apply option is missing on nested prefabs, so I think it is an issue of the b20+ that the option appears. Instead, just drag the prefab onto the scene (obviously at this point not into another prefab), make your changes, apply them and all nested instances should get the changes you desire and delete the prefab instance you put onto the scene.
     
  33. bobmoff

    bobmoff

    Joined:
    Sep 23, 2014
    Posts:
    44


    Thank you for the fast reply, and after posting this I actually read the documentation and realized that its better to simply click the green/yellow box and that context manu will show the currently available options, and when clicking a yellow one, apply is not available. It all makes sense now, sorry for being foolish :)

    The documentation is kind of hard to follow. I think its coz the game objects names are quite similar or something, so it was very hard to understand what was going on. Had to read it over and over again to grasp what you ment.

    Other than that the plugin works great! Thank you so much for making this, as this feels like it should be a native Unity feature. Yeah, great work! I started out using the NestedPrefab-plugin but I was really missing some indicating in the hierarchy what was going on.​
     
  34. bobmoff

    bobmoff

    Joined:
    Sep 23, 2014
    Posts:
    44
    Haha, just realized your not the creator. :)
     
  35. LarsRocks

    LarsRocks

    Joined:
    Oct 23, 2014
    Posts:
    10
    No problem ;)

    I seem to have an issue with applying changes to prefabs as well.
    I have .fbx files, which should be treated as nested prefabs. When I add a prefab to an fbx file, I can click apply (4.6b17) and my unity scene crashes. Sometimes instead of crashing there is a null pointer in PeprefabScriptExt.cs, line 188 (both, newObjectPrefabInstance and _this are null). Oddly enough when I run my own Editorscript which adds .fbx prefabs to empty transforms in another .fbx prefab, it works without a hinch.

    Am I just lucky that this works for my Editorscript and doesn't if I make changes through the Inspector?
     
  36. bobmoff

    bobmoff

    Joined:
    Sep 23, 2014
    Posts:
    44
    No idea. Call in the REAL creator:

    Ping @PrefabEvolution

    :)
     
  37. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    1. What version of the plugin you are use? Currently PEPrefabScriptExt.cs on line 188 contains only "{".
    2. If your editor crash after apply, can you send me an editor log? So i can extract exception stack trace.
    3. Sometimes unity 4.6b can crash when you trying to save assets, so you can try to disable Preferences -> Prefab Evolution -> Auto Save check box.
    4. Now plugin have a branch where i fix compatibility with 4.6b. But i can't publish this changes on the the Asset Store while 4.6 in beta. But if you would like to get this changes you can send me mail to PrefabEvolution@gmail.com and i will share it with you )
     
  38. LarsRocks

    LarsRocks

    Joined:
    Oct 23, 2014
    Posts:
    10
    1. Whoopsie. It was line 183. Sorry about that. I use version 1.3.1.
    newObjectPrefabInstance.ParentPrefab = _this.ParentPrefab;​
    2. Sure, I'll mail it to you.
    3. I will try that thanks :)
    4. That would be awesome.
     
  39. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    105
    I get this error message when I duplicate canvas children that are prefabs that allow nesting. At first I thought it was uGUI bug but now I am not so sure since it happens only with Prefab Evolution prefabs, not regular prefabs or non prefabs.

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.UI.ICanvasElement].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/CanvasUpdateRegistry.cs:107)
    UnityEngine.Canvas.SendWillRenderCanvases () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/UICanvasBindings.cs:152)
    UnityEngine.Canvas.ForceUpdateCanvases () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/UICanvasBindings.cs:153)
    UnityEditor.DrivenRectTransformUndo.ForceUpdateCanvases () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/DrivenRectTransformUndo.cs:17)
    UnityEditor.Undo.Internal_CallWillFlushUndoRecord () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/UndoBindings.cs:152)
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

    I am using 4.6f1

    P.S. how do you expose prefab properties for example label text you showed in your uGUI + Prefab Evolution demo?
     
    Last edited: Nov 10, 2014
  40. Milda

    Milda

    Joined:
    Jul 10, 2013
    Posts:
    1
    If I start my scene I got this 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.PEPrefabScriptExt.ApplyChanges (PrefabEvolution.PEPrefabScript _this, Boolean buildModifications) (at Assets/Scripts/ThirdParty/PrefabEvolution/Sources/Editor/PEPrefabScriptExt.cs:343)
    PrefabEvolution.PEUtils.DoApply (PrefabEvolution.PEPrefabScript script) (at Assets/Scripts/ThirdParty/PrefabEvolution/Sources/Editor/PEUtils.cs:364)
    PrefabEvolution.PECache+<CheckPrefab>c__AnonStorey6.<>m__6 () (at Assets/Scripts/ThirdParty/PrefabEvolution/Sources/Editor/PECache.cs:83)
    UnityEditor.EditorApplication.Internal_CallDelayFunctions ()

    Exists possibility how to find object which make problems?

    Supports PrefabEvolution Unity5?

    Thanks for your help.
     
  41. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Yep, I found this bug. So you can mail me on prefabevolution@gmail.com and i will send you a new build. I have run tests on Unity 5b10-13 and all of them are successful passed.
     
  42. Stals

    Stals

    Joined:
    Dec 1, 2014
    Posts:
    8
    Hi, can someone link to the Demo version? I can't seem to find it anywhere. (I would like to try it before buying if possible)
     
  43. racso2

    racso2

    Joined:
    Dec 3, 2014
    Posts:
    2
    Hi, I've experimenting some strange behavior of ‘children reordering’ after applying changes into prefabs that are nested into another prefabs.
    Specifically in the context of a nested prefab (B) that contains another simple nested prefab (A) and a list of extra GameObject added as children of the prefab (A)
    When the original prefab (A) is updated, then the children added to the modified instance of prefab A (in prefab B) are reordered randomly.

    I include below the steps needed to get this scenario. I'm using Unity 4.6 version:

    1- Create a prefab 'NestedP_A' (from any GameObject, a cube for example) and allow to be nested.
    2- Then create another prefab 'NestedP_B' (from any other GameObject, another cube) and allow to be nested too.
    3- Create an instance of 'NestedP_B'
    4- Add an instance of 'NestedP_A' into the existing 'NestedP_B'
    5- Add more than one GameObjects into nested 'NestedP_A' instance.
    6- Select 'NestedP_B' instance and apply changes. (Ok)
    7- Select the 'NestedP_A' prefab (not the modified instance) in the prefabs folder of the Unity Project Window and click into 'Apply' button.
    After this step the list of GameObjects added into NestedP_B->NestedP_A is reordered.


    NestedP_A (original prefab instance without children)

    NestedP_B
    NestedP_A (modified instance with a list of children)
    Sphere_1
    Sphere_2
    Sphere_3


    After select NestedP_A prefab and click in 'Apply' button

    NestedP_B
    NestedP_A
    Sphere_1
    Sphere_3
    Sphere_2


    Thanks in advance.
     
  44. racso2

    racso2

    Joined:
    Dec 3, 2014
    Posts:
    2
    Sorry, the example has lost the indentation and the prefabs hierarchy is not shown correctly.

    NestedP_A (original prefab instance without children)

    NestedP_B

    NestedP_A (modified instance with a list of children)
    Sphere_1
    Sphere_2
    Sphere_3

    After select NestedP_A prefab and click in 'Apply' button

    NestedP_B

    NestedP_A
    Sphere_1
    Sphere_3
    Sphere_2
     
  45. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    105
    When can we expect an update with 4.6 fixes since 4.6 is now out of beta?
    And how do you expose prefab properties for example label text you showed in your uGUI + Prefab Evolution demo?
     
  46. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    With 4.6.0p1, Prefab Evolution is completely broken.

    1) I can't save my scenes. It just doesn't save. Ctrl+S or Save command menu doesn't work!
    2) I can't change and apply my fbx import settings in inspector. When I hit apply, all the changes revert back to old settings. (I'm not sure if this happened before 4.6.0p1)

    When can we get a fix for 4.6???
     
    junk1er, Remiel and paradizIsCool like this.
  47. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    608
    I can't save my scenes!!! 4.6.0p1
     
  48. junk1er

    junk1er

    Joined:
    Feb 11, 2014
    Posts:
    4
    +1 !

    Using 4.6.0p1 instead of 4.6.0fx is pretty critical, because it has some critical fixes from 4.5.5p1-5...
    Thanks in advance...
     
  49. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. All who have a bug with 4.6p1 send me a mail to prefabevolution@gmail.com. And when i fix it i will send you fixed version.
     
  50. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Code (csharp):
    1. Subject: [PATCH] 4.6.0p1 fix
    2.  
    3. ---
    4. Assets/PrefabEvolution/Sources/Editor/PECache.cs | 3 ++-
    5. 1 file changed, 2 insertions(+), 1 deletion(-)
    6.  
    7. diff --git a/Assets/PrefabEvolution/Sources/Editor/PECache.cs b/Assets/PrefabEvolution/Sources/Editor/PECache.cs
    8. index fd4c682..5618231 100644
    9. --- a/Assets/PrefabEvolution/Sources/Editor/PECache.cs
    10. +++ b/Assets/PrefabEvolution/Sources/Editor/PECache.cs
    11. @@ -183,9 +183,10 @@ namespace PrefabEvolution
    12.                 PECache.Instance.CheckPrefab(path);
    13.             }
    14.  
    15. -            static void OnWillSaveAssets(string[] paths)
    16. +            static string[] OnWillSaveAssets(string[] paths)
    17.             {
    18.                 PECache.Instance.CheckPrefab(paths);
    19. +                return paths;
    20.             }
    21.         }
    22.  
    23. --
    24. 1.9.4.msysgit.2
    25.  
    This patch should fix plugin in 4.6.0.p1

    It was happen because Unity now don't save anything if you have OnWillSaveAssets with void return type...
     
    Last edited: Dec 9, 2014