Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
8
Question by skalev · Nov 05, 2013 at 09:48 AM · editor-scriptinganimationevent

Hiding Private Functions From AnimationEvents

When I create an AnimationEvent, I expect the available function list that shows up to only contain public functions that match the requirements. This works, but it also shows all of the private functions in my class that match. I want to be able and hide those from the list. Is there anyway to tell Unity to not show a function in the Event list drop down?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sstulov · Feb 07, 2014 at 03:12 PM 0
Share

It's funny though. I've bumped into this thread, because I've had exactly the opposite question. I'd expect animation events to fire only private functions to hide all the internal animation rubbish under the hood.

avatar image alemfi538 · Apr 07, 2014 at 11:06 PM 0
Share

Saw this thread as I was thinking that the function name drop down was getting out of hand and that there were no tags (HideInInspector does not work either) neither do protected/private affect whether the function shows. It's rather cluttered when you have a # of monobehaviors on the same level as the animator.

avatar image CafeAlternativo · Apr 10, 2015 at 08:21 PM 0
Share

I agree, private methods should be hidden.

avatar image 0boggart0 CafeAlternativo · Oct 20, 2016 at 08:13 PM 0
Share

I think there is more appropriate solution - "HideInAnimationAttribute" to explicitly mark unwanted methods from showing in animation as possible event. And to think further, it should be possible to apply this attribute per method or per class basis to achieve total control.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MagyarPeter · Mar 28, 2021 at 12:48 PM

Use internal variables. "internal int Test = 1;//this variable will not show up in the animation event list"

But there is another problem: how to use interfaces in this situation? I have to set all of my Interface variables to public, otherwise the interface will not see them. (my interface needs more than 50 public variables, and its flooding the animation event list)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to add new curves or animation events to an imported animation? 6 Answers

Can one Animation Event be used for a timespan (multiple frames)? 1 Answer

Player lose damage when enemy is attacking (animation) 1 Answer

AnimationEvent triggers twice 3 Answers

Transform Of GameObject getting changed incorrectly after updating RuntimeAnimatorController 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges