Ejemplo n.º 1
0
        public static Object Revert(Object obj)
        {
            var gameObject = obj as GameObject;

            if (gameObject && PrefabHelper.IsPartofPrefabStage(gameObject))
            {
                PrefabHelper.SaveOpenPrefabStage();
            }
            return(RevertObject(obj));
        }
Ejemplo 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.IsPartofPrefabStage(gameObject))
            {
                PrefabHelper.SaveOpenPrefabStage();
            }
            if (onHierarchyCommit != null)
            {
                onHierarchyCommit(obj);
            }
            VCCommands.Instance.CommitDialog(obj.ToAssetPaths(), includeDependencies: true, showUserConfirmation: showCommitDialog, commitMessage: commitMessage);
        }