-
Notifications
You must be signed in to change notification settings - Fork 343
Change PrefabBrushes Erase behaviour with small doc change. #200
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
Change PrefabBrushes Erase behaviour with small doc change. #200
Conversation
Additional memo, Deleting "Prefab protected field" is breaking change for API. |
Great suggestions! Using PrefabUtility.GetCorrespondingObjectFromSource to identify if the Prefab to be erased and the instance in the Scene is a better way to check if they are the same. However, I think keeping the ForceDelete functionality would be useful. This would allow users to quickly remove a different Prefab and replace it with one/s from the Brush without switching to a different Brush or removing it using the Hierarchy window. Finding the right Brush to erase from and switching back may take a while. Let me know what you think about this! Thanks! |
@ChuanXin-Unity Thank you!
Yeah, I agree that the feature to erase GameObject on Grid or Tilemap is useful 👍
GameObjectBrush has the feature to erase GameObject on Grid or Tilemap. By the way, PrefabBrush's erase feature is a little difficult to expect. In my thought, PrefabBrash should has only feature to handle Prefabs (from the name of PrefabBrush.) edited By the way, If you think that PrefabBrush needs the feature to erase GameObject force, I will add the feature in this PR. |
Yes, please! If possible, we should try to change the behaviour and name of ForceDelete to something like DeleteOwnedPrefabOnly. |
see below conversation #200 (comment)
Hi! I added the feature to erase any GameObjects to Prefab Brush. By the way, I changed implementation from before one. So let's talk about spec. Previous Implementation.
My Suggestion Implementation
I want to avoid that "forceDelete" boolean value storing in PrefabBrush Asset.
"DeleteOwnedPrefabOnly" is good name. But I want to set CheckBox name "Erase Any Objects". The reason why I chose "Erase Any Objects" are
|
This is great! Erase Any Objects sounds clearer as well! It is also good that you mentioned user preferences and serialized properties when used with source control repositories. I will keep that in mind too! Thank you for your help! |
🎉 Thanks! |
Thank you for adding this functionality and fixing my mistakes! For me it was the first pull request and it's nice to see that people from different countries can jointly develop open source software solutions. |
Change PrefabBrushes Erase behaviour with small doc change.
Overview
In this PR, I
Background
From name of PrefabBrush, I expect that PrefabBrush can only erase GameObject that is instantiated from the prefab.
By the way, current PrefabBrush can delete
This behaviours is not related to "Prefab". So I suggested this PR.
Detail for changing Erase behaviour.
PrefabBrush's Erase
Current:
My Suggestion:
PrefabBrush erases GameObject that is instantiated from the prefab.
To check GameObject that is instantiated from the prefab or not, PrefabBrush uses PrefabUtility.GetCorrespondingObjectFromSource
And delete ForceDelete field.
PrefabRandomBrush's Erase
Current:
PrefabBrush erases any GameObject in the cell.
My Suggestion:
PrefabBrush erases GameObject that is instantiated from the any prefab in prefab lists.
To check GameObject that is instantiated from the prefab or not, PrefabBrush uses PrefabUtility.GetCorrespondingObjectFromSource
Conclusion
From name of PrefabBrush, I expect that PrefabBrush can only erase GameObject that is instantiated from the prefab.