fungus
fungus copied to clipboard
Feature Request: Lock Flowchart
Is your feature request related to a problem? Please describe. I have a prefab that houses all of my fungus components that is present in all my scenes. When I need to modify a flowchart that is part of this prefab and I enter prefab mode, but if I do that while having selected the flowchart, I need to click the flowchart again while in prefab mode to edit the prefab version of it. Sometimes it happens that I forget this and I end up editing a flowchart accidentally NOT in prefab mode, leading to a lot of cherrypicking stuff to revert/apply to the prefab.
Describe the solution you'd like I'd like there to be a way to lock a flowchart from being edited until the lock is removed; no commands may be modified, no commands may be removed or added, or blocks moved.
This way I could make sure I only edit my flowcharts in prefab mode, but I think the use for this feature is wider range than that, a user may want to lock a flowchart they're finished working on and so on.
This should solve your problem https://docs.unity3d.com/ScriptReference/SelectionBaseAttribute.html
You may well do this. Toggle off the invisibility OR lock the object in the hierarchy. This was added since 2019 version
but isnt the SelectionBaseAttribute to do with scene view selection?
In the Unity Scene View, when clicking to select objects, Unity will try to figure out the best object to select for you.
I'm not selecting anything in scene view. All I'd like to do is lock the flowchart and all of the scripts on it from editing, so no commands or blocks can be added/removed/edited.
I've found a free asset on the store https://assetstore.unity.com/packages/tools/utilities/editor-aider-the-lost-jigsaw-71306#description and it locks the object in the hierarchy and it prevents me from editing the object's scripts.
and while it also prevents me from dragging around commands in the Flowchart window on blocks,
it doesnt stop me from dragging, adding or removing blocks
I think I may have a solution for this. I'll do some research over the weekend and report back.
@Arylos07 thanks, I look forward to hearing about your findings!
Okay, I definitely have a solution that is pretty lightweight. I'll try and get that added by Monday as a separate pull request.
#997 Adds this ability now. I feel like it can be a bit jank, but it is the best implementation I can think of without doing anything memory intensive like caching values.
Let me know what you think.
Cheers @Arylos07 i've added this now, I'll report back if I run into any issues!
This has been working wonderfully for the past weeks, I'll close the issue for now.
Hi @Arylos07 I lef this message on Discord as well, but I'm leaving it here for transparency:
I've been using your lock flowchart feature ever since you PR'ed in, and I only now ran into a bug with it, where it prevents editing the flowchart itself, I mean the actual Flowchart.cs on the gameobject, it seems like it redraws itself constantly if I try to edit it EVEN if the lock is off. I went back to a version right before I added the PR and the bug is not present there. Could you please take a look at this issue sometime? Thank you
Gif added to demonstrate (as soon as I click an editable field or open the inspector window selection thing, it gets redrawn)
Actually ignore this, I left this comment on the PR instead! #997
Why did you close this? The related pr is still active :)