Skip to content

Commit 662c654

Browse files
committed
Break Prefab Init
1 parent 96e0c84 commit 662c654

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

Assets/MapEditor/Editor/API/Functions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,14 @@ public static void ToggleLights(PrefabDataHolder target)
728728
target.ToggleLights();
729729
Elements.EndToolbarHorizontal();
730730
}
731+
732+
public static void BreakPrefab(PrefabDataHolder target)
733+
{
734+
Elements.BeginToolbarHorizontal();
735+
if (Elements.ToolbarButton(ToolTips.breakPrefab))
736+
target.BreakPrefab();
737+
Elements.EndToolbarHorizontal();
738+
}
731739
#endregion
732740

733741
#region Functions

Assets/MapEditor/Editor/PrefabDataHolderEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ public override void OnInspectorGUI()
1414
Functions.PrefabID(script);
1515
Functions.SnapToGround(script);
1616
Functions.ToggleLights(script);
17+
Functions.BreakPrefab(script);
1718
}
1819
}

Assets/MapEditor/Managers/PrefabManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ public static void ReplaceWithDefault(PrefabDataHolder[] prefabs, int progressID
141141
}
142142
}
143143

144+
public static void BreakPrefab(GameObject prefab)
145+
{
146+
}
144147

145148
private static class Coroutines
146149
{

Assets/MapEditor/WorldData/PrefabDataHolder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ public void ToggleLights()
3535
foreach (var item in gameObject.GetComponentsInChildren<Light>(true))
3636
item.enabled = !item.enabled;
3737
}
38+
39+
public void BreakPrefab() => PrefabManager.BreakPrefab(gameObject);
3840
}

0 commit comments

Comments
 (0)