- Home /
How do I hide methods from the animation event inspector window?
When I add an animation event the inspector displays every method (not just public ones) from every script in the game object including "Fixed Update". How can I hide non public methods from the inspector? [HideInInspector] doesn't work.
Answer by glitchers · Nov 09, 2017 at 11:41 AM
For me I could change my methods from public
to internal
. This allows it to be essentially public within your code but not to external.
I use it to keep my events list tidy and short so people using the editor don't have to scroll through a lot of options - especially methods they should not be calling!
More info can be found here: https://stackoverflow.com/questions/165719/practical-uses-for-the-internal-keyword-in-c-sharp
It's work life hack, but what if I have hard implementation of "public" method because I am using interface inheritance?
So in this case I still need to hide method in Inspector.
Implementing interface methods you can define them like this
void I$$anonymous$$yInterface.DoTheThing()
Ins$$anonymous$$d of:
public void DoTheThing()
Does that help @atorisa
Your answer
Follow this Question
Related Questions
Animation Editor not seeing (all) the properties of my component 0 Answers
Issue with mecanim playing an animation using setbool 1 Answer
(2D) What is the best way to implement a run-and-shoot animation? 1 Answer
Instantiated Object Wont save a reference to the prefab, instead sets to itself 1 Answer
Multiple Cars not working 1 Answer