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
1
Question by calebheale · Jul 12, 2014 at 03:05 AM · editor

Are any UnityEditor Classes available at runtime (outside of the editor)?

Title pretty much says it all. Though if some are and some are not, I would also be curious where I could find information on the distinction.

I was originally using AssetDatabase.LoadAssetAtPath to find an AnimationClip in a script at runtime, but then I came across a few posts (including this one) saying that this wont work. I looked in the documentation and am not seeing anything about this, which I thought was strange. But then I started thinking, maybe I'm already supposed to know this because none of the UnityEditor classes are available at runtime? If so, I don't remember ever seeing anything about this anywhere.

The function was working just fine when I was testing it, but having seen a few different posts saying it wont work, I'm assuming it was only working because I was testing with the play button in the editor (which also seems strange, but with the given information that is the best guess I can come up with).

Hopefully someone can shed some more light on this for me.

Comment
Add comment · Show 2
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 yoyo · Jul 12, 2014 at 06:20 AM 0
Share

You can refer to UnityEditor classes in any script in the Editor, but then you won't be able to make a standalone build of your project. The closest you get at runtime to AssetDatabase.LoadAssetAtPath is Resources.Load, which assumes the asset in question lives under a "Resources" folder.

avatar image calebheale · Jul 12, 2014 at 08:38 AM 0
Share

Thanks for the tip. I had originally saw that and avoided it because I took its description to mean there had to be a single Resources folder with everything in it (and I just really hated the idea of a file structure like that). Upon closer inspection, I see that isn't the case, so this is a realistic solution for me.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by tswalk · Jul 12, 2014 at 06:10 AM

http://answers.unity3d.com/questions/309300/using-unityeditor-in-runtime.html

nope... the assembly is not included in builds... apparently.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Permanent handles (when object is not selected) 1 Answer

Check if a script is running in editor or game 2 Answers

CustomEditor for 2 List to look like dictionary 1 Answer

Determining which Asset is connected to a GameObject. 3 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