private static Object RevertObject(Object obj) { if (ObjectUtilities.ChangesStoredInScene(obj)) { SceneManagerUtilities.SaveActiveScene(); } bool success = VCCommands.Instance.Revert(obj.ToAssetPaths()); if (success && onHierarchyReverted != null) { onHierarchyReverted(obj); } return(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.IsPrefab(gameObject, true, false) && !PrefabHelper.IsPrefabParent(obj)) { PrefabHelper.ApplyPrefab(gameObject); } if (onHierarchyCommit != null) { onHierarchyCommit(obj); } VCCommands.Instance.CommitDialog(obj.ToAssetPaths(), showCommitDialog, commitMessage); }
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); }