Improved prefabs workflow critique

Hello,

i started working with improved prefabs as soon as 2018.2.X Improved Prefabs preview came out, and continued with beta straight away, so i think i have enough hours in it to post some observations.

I’m not really a power user since i’m using Unity for mere three years, but i’m not a rookie either so speed of the workflow is quite important to me, and that’s where my objection is.

Removing the inspector from prefabs and putting the open prefab button brings two more clicks (open prefab and save, auto save slows things to death) to the workflow, which is a lot when you’re dealing with many prefabs.

While the separate prefab workspace is neat for initial visual configuration od the prefab, i usually don’t find the need to use it ever again after the first time and most of the dealings with the prefab afterwards consist of fiddling with it via inspector, and having to enter the prefab mode every time just to see if that’s the prefab i wanted to use and then edit the inspector values is time consuming.

Also, ability to bulk edit the common prefab components in the project view has been taken away from us, so now we have to drag every nested prefab into the scene one by one, select them all then edit the components in bulk. Not a function i use often, but still i believe it’s a step back from the usual.

As someone said, the whole thing seems a bit over engineered. Deeper prefab levels are something we all waited for, but i’m not sure the whole prefab workflow is the thing we needed.

20 Likes

I agree that as soon as we started working with the new workflow this was the first thing that struck me as being very tedious… Don’t get me wrong, I love the whole new system accept that little part.

Creating variants from a list of imported models and only needing to make them static took me quite some time having to open all of the individual variants and checking the static checkbox along with some additional lighting settings.

3 Likes

I also agree…I might make use of the new prefab workflow in the future but currently in my on-going project, modifying prefabs got so tedious…I hope the prefab interface and the workflow get improved in the course of beta. For me, there are 3 crucial things missing in the new system.

  1. As the op mentioned, please bring back the prefab inspector when selecting prefabs in project window. You need 3 clicks just to see what components the prefab has and the focus is lost in the project window after these clicking.

  2. We have big “Overrides” button on the inspector now but please consider placing “Apply” button next to it even if it’s as small as 8x8 pixels, less clicking.

  3. An ability to edit prefabs without opening the prefab window…

Overall, I’m missing the old prefab workflow a lot. I applogize if it sounded like a rant but it’s just my feedback.

6 Likes

While it’s nice to be able to create nestable prefabs, (I think) we don’t need every prefab to be nestable. Most of the cases, I just throw gameobjects to Resources folder so that I can instantiate them on the fly without having them always sit in the game scene. And for those “Singleton” prefabs, the old prefab workflow is much better. It would be nice if you could toggle between the old prefab and the new one. Or maybe add a component which makes a prefab work like before…which is kind of ironic though if you know what asset store devs have been doing to make prefabs nestable(for years).

3 Likes

Another two weeks passed and i can say i’m already pissed off by having to open prefab, open prefab, open prefab, instead to access the inspector immediately.

4 Likes

Nearest workaround I could get is a custom window to load and draw inspector controls for currently selected prefab in project view.
screenshot

Made with fairly hasty copy/paste, so it’s messy and no guarantees given that it won’t break something, but it might help as a starting point if someone wants to clean it up/make sure it’s safe:

code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;

public class PrefabInspector : EditorWindow
{

    [MenuItem("Custom/Prefab Inspector")]
    public static void ShowWindow()
    {
        EditorWindow.GetWindow(typeof(PrefabInspector));
    }

    private void OnEnable()
    {
        OnSelectionChange();//check selection if recompiling scripts/opening window
    }

    private void OnDisable()
    {
        CleanupExisting();
    }

    private void CleanupExisting()
    {//release memory etc
        if( goEditor != null )
        {
            DestroyImmediate(goEditor);
        }
        if( componentEditors != null )
        {
            foreach( Editor componentEditor in componentEditors )
            {
                if( componentEditor != null )
                {
                    DestroyImmediate(componentEditor);
                }
            }
            componentEditors.ClearFast();
        }
        if( inspectObject != null )
        {
            if( prefabPath != "" )
            {//prefab utility save it
                PrefabUtility.SaveAsPrefabAsset(inspectObject, prefabPath);
            }
            PrefabUtility.UnloadPrefabContents(inspectObject);
        }
        prefabPath = "";
        inspectObject = null;
    }

    private string prefabPath = "";
    private void OnSelectionChange()
    {
        CleanupExisting();
        if( Selection.activeObject == null || !(Selection.activeObject is GameObject) )
        {
            return;
        }
        foreach( GameObject go in Selection.GetFiltered(typeof(GameObject), SelectionMode.Assets) )
        {
            prefabPath = AssetDatabase.GetAssetPath(go);
            if( !string.IsNullOrEmpty(prefabPath) && File.Exists(prefabPath) && prefabPath.EndsWith(".prefab") )
            {//selected is a prefab, ideally in project view?
                //inspectObject = go; //For a read-only viewer, uncomment this and instead comment out the line below as well as the saving/unloading code in CleanupExisting
                inspectObject = PrefabUtility.LoadPrefabContents(prefabPath); //Something like this to load, then code to save in CleanupExisting
                if( inspectObject != null )
                {

                    goEditor = Editor.CreateEditor(inspectObject);
                    if( goEditor == null )
                    {
                        CLI.OutputLine("NullEditor...");
                    }
                    else
                    {
                        if( componentEditors == null )
                        {//todo: reinit
                            break;
                        }
                        foreach( Component c in inspectObject.GetComponents<Component>() )
                        {
                            if( c is UnityEngine.UI.Image )
                            {
                                Editor componentEditor = Editor.CreateEditor(c as UnityEngine.UI.Image);
                                if( componentEditor != null )
                                {
                                    componentEditors.Add(componentEditor);
                                }
                            }
                            else
                            {
                                Editor componentEditor = Editor.CreateEditor(c);
                                if( componentEditor != null )
                                {
                                    componentEditors.Add(componentEditor);
                                }
                            }
                        }
                    }
                    break;
                }
            }
        }
        Repaint();//force OnGUI redraw
    }

    private GameObject inspectObject;

    private Editor goEditor;
    private List<Editor> componentEditors = new List<Editor>();
    void OnGUI()
    {
        if( goEditor == null )
        {
            EditorGUILayout.LabelField("No prefab selected");
            return;
        }
        else
        {
            goEditor.DrawHeader();
           // goEditor.OnInspectorGUI(); //seems to do nothing
           //goEditor.DrawDefaultInspector(); //lists just object properties with no proper format
            if( componentEditors == null )
            {
                return;
            }
            foreach( Editor componentEditor in componentEditors )
            {
                componentEditor.DrawHeader();//seems to draw component icon but gameobject's name, and wider than normal.
                EditorGUILayout.LabelField("Component: " + componentEditor.target.GetType().Name); //Show component type, since DrawHeader doesn't list it.
                componentEditor.OnInspectorGUI();
                //componentEditor.DrawDefaultInspector(); //lists with no proper format
            }

        }
    }
}
7 Likes

Thanks man, i’ll give it a try.

@runevision : this needs to be the default behavior.

6 Likes

I second that.

2 Likes

There is something I really cannot understand about Unity is that they try to make things Simple yet they don’t know how it makes things inconvenient to use. Simple-to-use and Easy-to-use are NOT the same!!! Having one Global Inspector for everything makes a clean UI but it is very difficult to use. I usually have several Inspectors open just in case I have to lock and compare stuff. Unity’s workflow has lots of go back-and-forth and back-and-forth yet there is not even the navigation history support. If they intended to keep the same UI for more than 10 years, they could at least make go back-and-forth easier. It’s so dumb and they should feel ashamed.

Getting rid of Prefab inspectability is another attempt to make things simpler but it works against the workflow. I’m not really sure if they have any UX guy working for Unity.

I think having as many Custom Inspectors (toggled on-and-off and it’s context locked to the window it belongs) where it makes sense are necessary and we need to bring back Prefab Inspectability.

I described Custom Inspectors more in detail in this thread. My biggest pain points
It can coexist with the current UI and it’s not even that difficult to make it and it will save us so much time.
Unity guy made a reply that they are looking into it but Unity often cancels projects without warnings so I don’t know what’s going to happen.

I really hope someone at Unity takes a responsibility instead of relying on Asset developers to fix their problems.
The current Unity workflow is so bad but there is very little sign of changes. Even if there is, the progress is so slow and I feel that we are lucky to have it.

3 Likes

+1

The new prefab system is great but having to open prefabs any time you want to make a small change is very tedious. Fixing this one thing will dramatically increase the usability of the new system.

6 Likes

They could make the whole system much more efficient, but ok, it’s the first iteration in beta, i hope they’ll work on it. I don’t like proposing solutions because that’s not my job, but the workflow that i would prefer is the following:

When i click on the prefab in project view, the inspector should open automatically to edit the prefab (the way it was before) but with the button for prefab editing mode in an isolated environment which is present now with open prefab button.

Editing instances is fine the way it is now, with override button.

And that’s all there is. I don’t see why many more people are complaining because it’s a huge workflow problem, but i guess a lot of folks are still holding on to older version for projects that are still being worked on.

2 Likes

I think the main issue with the new prefab system is that it breaks away from the old system very clearly…
Where the real issue is so far I noticed is related to all the UI tools developed to work with the old system. I have spend last couple of weeks just recreating 75-90% of our tools from scratch and the more complicated ones that were hacking around the security free old prefab system are showing the constraints of the new system.

I do believe that the new system will be better, still few things to iron out, but the cost to switch from old to new can be very tedious… And trying to explain what crazy script you wrote as UI hack on the forum is not straight forward either.

1 Like

Absolutely agreed. I posted the same thing here: How to preview Prefabs? - Unity Engine - Unity Discussions but this thread seems to be getting more traction.

The other problem is that you often want to open the properties of a prefab, yet still retain visibility of your currently open scene. Maybe you want to pick a colour from your scene, for example.

I’m fine with ‘Open Prefab’ as a button at the top, to view the prefab individually, but the old capability to just view the prefab properties directly needs to be retained.

‘One more click’ might sound minor to an engineer, but from a usability POV it is hugely detrimental to the extent that I’m delaying my move from 2017.4 LTS to 2018 partly because of this.

4 Likes

Just watched Ciro’s intro talk

I have the exact same concerns as you. In his examples of having a rock prefab it is so obvious that you want to edit it in the context of the scene, you cannot tweak scale in isolation. Besides the initial setup i dont think there is any use for entering this prefab mode, at all. Never have i thought “gee i wish the rest of the scene was not visible now”.

And not seeing the properties in the inspector is such a dealbreaker, it makes it unusable in our project. We have prefabs for different unit types, i cannot understand why you’d take away the ability to see their property at a glance, or multi edit them.

I was looking forward to 2018.3, but i wish there would be an option to disable this new prefab workflow because its unusable and worse than what we have.

7 Likes

I would disagree on the unusability, it just takes time to figure out the different way of thinking.

no inspector in editor mode is clearly an UX regression, but there are some scripts out there to help and I do hope Unity will just add it asap with a patched version.

I have not yet got to a real issue about losing multi edit (mainly cause of the inspector issue), but at the same time using nested prefabs can solve that as well… want to change the image of 15 different prefabs, well if they are nested prefabs can do that very easily or even with variants…

Variants are neat.

But firstly it takes time to upgrade systems, secondly you cannot know in advance what is shared and what isnt. During iteration its tedious to variantify and devariantify things constantly.

And mostly i just want to quickly glance at an object to see if its in order, or maybe even see the differences. With multiselect that is possible now, in the new version that is not.

3 Likes

Looks like this functionality was officially removed, explanation here:

Can we get back the ability to edit Prefabs directly in the Project Browser?
No, this is not viable. Some technical changes were needed in the Prefabs back-end in order to be able to robustly support nesting. These changes mean that Prefabs are technically imported assets, and this in turn means that they can’t be edited directly. Prefab Mode is the new way to edit Prefab Assets. Compared to the old workflow of editing directly in the Project Browser, Prefab Mode lets you edit objects at any depth, and lets you visually see what you’re doing in the Scene View too.”

It looks like some more elaborate tools (from our own studios) will be needed to support game designers working within Unity. For example, in the past you could just click between weapon prefabs, and compare and contrast easily (eg. damage values). Now the ‘open prefab’ will break up that entire flow. Maybe some kind of google spreadsheets integration, with the values stored there and refreshed into the engine as required.

Off-topic, but I think these kind of changes signal that the era of the solo developer is nearing its end. Engines are becoming more complex, Unity is becoming more like Unreal. Unless you are an exceptionally talented individual like Lucas Pope who is willing to spend 3 years on a game, the future will be Game Designer + Unity Developer (Programmer) + Artist.

All of this is not entirely a bad thing, since its probably a better and more sustainable workflow (and hopefully I will end up in a small team anyway), just interesting to note.

1 Like

You can start with this https://discussions.unity.com/t/716001/6

I think that it is still possible to do solo games with the help of the asset store…
not being able to edit the damage output of a weapon on the prefab doesn’t make editing all of a sudden a lot more complex… With little work you can still get that effect. you can make a scene that dynamically loads all weapons of the game and display their stats + extra calculations. From there you can save prefabs from script, create variants maybe depending on what your game needs :wink: