Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New prefabs workflow support for patcher #40

Open
wants to merge 1 commit into
base: upm
Choose a base branch
from

Conversation

dmitry1100
Copy link

The patcher missed feature to edit patches inside prefabs. Since Unity 2018.3 there is a new prefabs workflow that loads prefabs into isolated preview scene which operates almost as play scene. This pull request extends patcher to edit prefabs based on the new workflow. The feuture is conditioned under UNITY_2018_3_OR_NEWER.

@keijiro keijiro self-assigned this Apr 17, 2019
@dmitry1100
Copy link
Author

dmitry1100 commented Feb 21, 2020

I've force-pushed my feature branch with the following update: When the patch is part of prefab instance it is not enough to just Undo.RecordObject() to 100% garanty it will be saved. This code impacts not only prefab editing mode but also usual scene editing mode because scene objects can be prefab instances as well and potintially can lose changes without a call to PrefabUtility.RecordPrefabInstancePropertyModifications() in the end of changes. I mean all changes should be between undo and property modifications recording calls:

Undo.RecordObject(obj, "Changes");

// Perform changes here

if (PrefabUtility.IsPartOfPrefabInstance(obj))
    PrefabUtility.RecordPrefabInstancePropertyModifications(obj);

PS: I've found this requirement in the official documentation after I'd met a bug with partially losen data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants