mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 21:08:28 +00:00
unpack prefab
This commit is contained in:
parent
9b0757679f
commit
0b3fa3a436
1 changed files with 7 additions and 1 deletions
|
@ -177,8 +177,14 @@ namespace SanAndreasUnity.Editor
|
|||
cell = Cell.Instance;
|
||||
if (cell != null)
|
||||
{
|
||||
if (!EditorUtility.DisplayDialog("", $"Found existing {nameof(Cell)} script in scene. Would you like to use this game object for creating world objects ?", "Ok", "Cancel"))
|
||||
if (!EditorUtility.DisplayDialog("", $"Found existing {nameof(Cell)} script in scene. Would you like to use this game object for creating world objects ?\r\n\r\nIf it is part of a prefab, the prefab will be unpacked.", "Ok", "Cancel"))
|
||||
yield break;
|
||||
|
||||
if (PrefabUtility.IsPartOfPrefabInstance(cell.gameObject))
|
||||
{
|
||||
PrefabUtility.UnpackPrefabInstance(PrefabUtility.GetNearestPrefabInstanceRoot(cell.gameObject), PrefabUnpackMode.OutermostRoot, InteractionMode.AutomatedAction);
|
||||
EditorUtilityEx.MarkActiveSceneAsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
if (null == cell)
|
||||
|
|
Loading…
Add table
Reference in a new issue