⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

wappenull/UnityPrefabTester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityPrefabTester

Project version is now 2019.3.15f

Alt text

Ultimate prefab property tester for nested prefab era. This is editor script to demonstrate ALL* prefab related API in Unity Editor. *(Except prefab variant related)

It will test/distinguish selected game object if it is "part of" or "root of" any prefab type. Including

  • Prefab Asset (The one that sits in Asset folder)
  • Prefab Instance (The one that dragged into scene)
  • Prefab Stage (Editing prefab intermediate in UnityEditor prefab edit mode)

Including resolve nearest asset path, root of prefab if available.

To try the example API, import package or open demo project. Select menu Tool->Prefab tester API example

Related API used:

  • PrefabUtility.IsPartOfPrefabAsset
  • PrefabUtility.GetNearestPrefabInstanceRoot
  • PrefabStageUtility.GetCurrentPrefabStage
  • PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot
  • AssetDatabase.GetAssetPath

Possible useful scenario:

  • Useful for some editor script automation based on prefabs.
  • Originally, I write this code to fix Mirror network plugin issue on determining assetPath on NetworkIdentity in complex cases which my game is using.

About

Ultimate prefab property tester for nested prefab era.

Topics

Resources

License

Stars

Watchers

Forks

Languages