public static Object Revert(Object obj) { var gameObject = obj as GameObject; if (gameObject && PrefabHelper.IsPartofPrefabStage(gameObject)) { PrefabHelper.SaveOpenPrefabStage(); } return(RevertObject(obj)); }
public static void ApplyAndCommit(Object obj, string commitMessage = "", bool showCommitDialog = false) { var gameObject = obj as GameObject; if (ObjectUtilities.ChangesStoredInScene(obj)) { SceneManagerUtilities.SaveActiveScene(); } if (PrefabHelper.IsPartofPrefabStage(gameObject)) { PrefabHelper.SaveOpenPrefabStage(); } if (onHierarchyCommit != null) { onHierarchyCommit(obj); } VCCommands.Instance.CommitDialog(obj.ToAssetPaths(), includeDependencies: true, showUserConfirmation: showCommitDialog, commitMessage: commitMessage); }