Add RemoveParameters method
close #11
Merging this pull request is unnecessary if you decide to merge pull request #15.
Hi,
Thank you for your PR; I'm currently taking a break from active development of my projects due to stress in order to manage my personal well being, so I will not be able to work on this project nor merge this PR anytime soon (could be a week to a month, I don't know).
Still, I glanced over this PR and I think that this does not yet fullfill all cases.
Parameter must not be removed if any of the following is true:
- [ ] There is at least one state that uses it as Motion Time, Speed, or Cycle Offset.
- [ ] There is at least one state that uses it as Mirror.
- [x] There is at least one state with a Driver behavior that sets it.
- [ ] There is at least one animation clip anywhere (including inside a blend tree) that has a curve binding which animates the Animator using that as the parameter.
- [ ] There is at least one blend tree or nested blend tree that uses it as any of its corresponding Blend Parameters depending on the blend tree type.
- [ ] There is at least one transition (including transitions from sub-state machine nodes) that uses it as a condition.
I'm willing to work on this PR myself once I'm back into development, as I had planned to expose such a cleanup function at some point.
However, it will likely be based on top of the sub state machine PR #6 (as there's additional work regarding sub state machine transitions).
Now, I remember that one of the things that demotivated me from implementing this functionality is that it's an expensive operation due to the amount of introspection that needs to be done at the entire animator level. For very large animators, this may be an operation that could take a few noticeable hundreds of milliseconds to resolve.
I think there's something that needs to be exposed at the animator level for wide affecting operations like this.