Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }