Skip to content

A tool to re-connect an unpacked prefab instance to its original prefab

License

Notifications You must be signed in to change notification settings

NewBloodInteractive/PrefabLinker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrefabLinker

A tool to re-connect an unpacked prefab instance to its original prefab (or one with a compatible hierarchy.)

GUI Usage

Access the PrefabLinker GUI through the Tools -> Prefab Linker menu item.

Preview

  • Prefab Instance: The unpacked/disconnected GameObject that you wish to link to a prefab.
  • Prefab to Link: The prefab to which the GameObject will be linked (through the creation of a new prefab variant.)

You then have two options to proceed:

  • Link and Replace: This will generate a new prefab variant and replace the original asset. This should only be used if the GameObject you supplied for Prefab Instance is itself a prefab.
  • Link As New Scene Object: This will generate a new prefab variant and store it in the active scene. You may then drag it into your project to save it.

Code Usage

The NewBlood.PrefabLinker class exposes a single public static method for generating a new prefab variant from an instance and prefab:

/// <summary>Creates a new variant of <paramref name="prefab"/> based on <paramref name="instance"/>.</summary>
/// <param name="instance">A GameObject with a hierarchy compatible with instances of <paramref name="prefab"/>.</param>
/// <param name="prefab">The prefab upon which the returned variant will be based.</param>
/// <returns>The new prefab variant, or <see langword="null"/> upon failure.</returns>
public static GameObject CreatePrefabVariant(GameObject instance, GameObject prefab)

About

A tool to re-connect an unpacked prefab instance to its original prefab

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages