Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by arisonu123 · Apr 20, 2017 at 06:48 PM · animationeditoranimatoreditor-scriptingreflection

How to tell if an animation clip is playing in the editor(NOT in playmode) with an editor script

Hi! I'm trying to tell if an animation clip is playing in the inspector. This clip is just being played from an animation clip inspector. Is it possible to tell if an animation clip is playing in the editor preview window and not in the game? I've been trying to do it with reflection by trying to access the AnimationInspectorEdtior and getting the animation controller from it but am unsure how to get my specific instance of this AnimationInspectorEditor(this is also the first time I've tried to use reflection so its entirely possible I'm doing it wrong). If anyone knows of a better way/has a solution please share.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by shadowpuppet · Apr 20, 2017 at 07:18 PM

if I understand your question, if the model is selected ( with animation on it) and it appears in the inspector, just hit the play button and there is a little red line ( playhead) that moves across as the clip plays ( if it is playing). If nothing appears in that window ( for animations imported without a model) drag the appropriate model for that animation into the play windowalt text


playhead.jpg (61.3 kB)
Comment
Add comment · Show 1 · 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
avatar image arisonu123 · Apr 20, 2017 at 10:39 PM 0
Share

Hi Shadowpuppet. I'm not simply trying to preview an animation in the editor, I'm trying to tell what animation is being previewed. I want something else to happen when the animation is previewed. This is for a tool I'm working on. I used reflection to end up with two inspector windows at the same time, one of them created by code when an animation is put into my animation clip variable, the other one is a custom inspector for a custom serializable object. I want to be able to tell when that animation is playing in the editor, not in the game.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Instance gotten with reflection is throwing a null reference when trying to access its fields with reflection. 1 Answer

How to play mecanim animations in Editor mode? 2 Answers

2D Animation does not start 1 Answer

What hooks exist for modifying and drawing in the animator window? 0 Answers

Resolve AnimationClip curve binding at runtime. 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