Prefab Evolution Plugin(nested prefabs)

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.

Hi
Are you write it Using C#?

Please Kill standard Revert/Apply buttons. They Hell.
If you can make workflow like Unity present on Unite 2012: https://www.youtube.com/watch?v=24AY4fJ66xA#t=3571
It the best solution that I ever see.

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…

Video published. Wait for comments)

:smile: Very cool, I think many people will help with projects. Where is the plugin available?

It’s not available yet. After testing it will published in Asset Store. Think after 1-2 weeks…

Good plugin :slight_smile:

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

Why you so hate this button?:slight_smile:

Some Unity secret for you:

[CustomEditor(typeof(GameObject))]
[CanEditMultipleObjects]
public class OverrideGameObjectInternalEditor : Editor
{
	protected override void OnHeaderGUI()
	{
		//Your GameObject inspector header GUI
	}
}

Thanks I know this trick but there I need more code or inhewrit from Unity GameObject Editor :slight_smile:

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 :slight_smile: 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

" 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 :slight_smile: :

using UnityEditor;
using UnityEngineInternal;
using UnityEngine;
using UnityEditorInternal;
using System.Reflection;

[System.AttributeUsage(System.AttributeTargets.Class)]
public class OverrideInternalEditorTypeMarkAttribute:System.Attribute
{
	public System.Type type;
	public OverrideInternalEditorTypeMarkAttribute(string typeName)
	{
		var types = System.Reflection.Assembly.GetAssembly(typeof(Editor)).GetTypes();
		foreach(var type in types)
		{
			if (type.Name != typeName)
				continue;
			
			this.type = type;
			break;
		}
		if (this.type == null)
			Debug.LogError("Type not found:"  + typeName);
	}
}
public class OverrideInternalEditor : Editor
{
	public Editor _baseEditor;
	public Editor baseEditor
	{
		get
		{
			if (_baseEditor == null)
			{
				var atr = System.Attribute.GetCustomAttribute(this.GetType(), typeof(OverrideInternalEditorTypeMarkAttribute)) as OverrideInternalEditorTypeMarkAttribute;
				if (atr != null)
				{
					if (this.targets != null  this.targets.Length > 0)
						_baseEditor = CreateEditor(this.targets, atr.type);
				}
				else
				{
					Debug.Log("A!!!!!!!!!!!!");
				}
			}
			return _baseEditor;
		}
	}
	
	void OnEnable()
	{
	}
	
	void OnDisable()
	{
		DestroyImmediate(_baseEditor);
	}

	protected override void OnHeaderGUI()
	{
		var method = baseEditor.GetType().GetMethod("OnHeaderGUI",  BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
		method.Invoke(baseEditor, new object[0]);
	}
	
	public override GUIContent GetPreviewTitle ()
	{
		if (target == null)
			return null;
		return baseEditor.GetPreviewTitle ();
	}
	
	public override string GetInfoString ()
	{
		if (target == null)
			return "";
		return baseEditor.GetInfoString ();
	}
	
	public override bool HasPreviewGUI ()
	{
		if (target == null)
			return false;
		return baseEditor.HasPreviewGUI ();
	}
	
	public override void OnInspectorGUI ()
	{
		if (target == null)
			return;
		baseEditor.OnInspectorGUI ();
	}
	
	public override void OnInteractivePreviewGUI (Rect r, GUIStyle background)
	{
		if (target == null)
			return;
		baseEditor.OnInteractivePreviewGUI (r, background);
	}
	
	public override void OnPreviewGUI (Rect r, GUIStyle background)
	{
		if (target == null)
			return;
		baseEditor.OnPreviewGUI (r, background);
	}
	
	public override void OnPreviewSettings ()
	{
		if (target == null)
			return;
		baseEditor.OnPreviewSettings ();
	}
	
	public override Texture2D RenderStaticPreview (string assetPath, Object[] subAssets, int width, int height)
	{
		if (target == null)
			return null;
		
		return baseEditor.RenderStaticPreview (assetPath, subAssets, width, height);
	}
}

[CustomEditor(typeof(GameObject))]
[CanEditMultipleObjects]
[OverrideInternalEditorTypeMark("GameObjectInspector")]

public class GameObjectEditorOverride : OverrideInternalEditor
{
	protected override void OnHeaderGUI()
	{
			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!!!
	}
}

Oh Thanks :slight_smile:

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

These keys will never be pressed again :slight_smile:

1574183--93412--$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 :slight_smile:

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 :slight_smile:

And also add there exposed properties and HideInInspector all subobjects of Prefab :slight_smile:

very impressive video. any idea on how much this will be once released?

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?

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 :slight_smile:

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

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…

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.

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.

So i have published a new demo video that shows how this plugin can save your time.