static internal void RevertToParent(this PEPrefabScript _this)
        {
            _this.Modifications = new PEModifications();
            var thisPrefab       = _this.Prefab;
            var thisParentPrefab = _this.ParentPrefab;

            var newInstance = _this.ReplaceInPlace(_this.ParentPrefab, false);

            newInstance.Prefab       = thisPrefab;
            newInstance.ParentPrefab = thisParentPrefab;
        }
Exemple #2
0
        static IEnumerator SelectObjectRoutine(PEPrefabScript prefabInstance)
        {
            EditorGUIUtility.ShowObjectPicker <GameObject>(null, false, "t:Prefab", 1);
            Object obj = null;

            while (EditorGUIUtility.GetObjectPickerControlID() == 1)
            {
                obj = EditorGUIUtility.GetObjectPickerObject();

                yield return(null);
            }
            if (obj != null && EditorUtility.DisplayDialog("Replace", string.Format("Do you want to replace {0} with {1}", prefabInstance.gameObject.name, obj.name), "Replace", "Cancel"))
            {
                prefabInstance.ReplaceInPlace(obj as GameObject, EditorUtility.DisplayDialog("Replace", "Apply modifications from current instance?", "Apply", "Don't apply"), false);
            }
        }
 static internal void Revert(this PEPrefabScript _this)
 {
     _this.Modifications = new PEModifications();
     _this.ReplaceInPlace(_this.Prefab, false);
 }