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
3
Question by Mattivc · Jun 29, 2012 at 11:40 AM · editorprefabpreview

Getting at the prefab preview window

I am currently working on a Level Editor for my game, a Editor extension not runtime.

Basically its a row of buttons, each corresponding to a prefab they will instantiate in the scene. Right now i have to manually create a icon for each button, and this isn't very optimal as i have quite a few items. Also, many of them may change during the development of the game. Which makes me have to update the icon.

The ideal solution would be for the icon to be generated automatically, a small version of whats get shown in the preview window when the prefab is selected.

Is there any way of doing this? Either by somehow rendering the preview to a image and then use that. Or by rendering the preview window on the actual button.

Comment
Add comment · Show 1
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 geniuscd · Jan 24, 2013 at 10:59 AM 0
Share

I have the EXACT needs! anyone found a solution?

3 Replies

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

Answer by Mattivc · Jan 24, 2013 at 11:25 AM

This problem has now been solved thanks to the new AssetPreview class in 4.x

 AssetPreview.GetAssetPreview(Object);

Will return a image of the given gameObject.

Comment
Add comment · Show 2 · 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 geniuscd · Jan 24, 2013 at 12:29 PM 0
Share

works gr8!, but if i need this on runtime? thanks for you quick answer :)

avatar image Tanoshimi2000 · Jun 05, 2014 at 05:34 PM 0
Share

This seems like what I need, but do I have to create/instantiate each prefab I have to get a preview of it? I have 10 prefabs and I want to get the Preview of each. Do I need to create an instance of the prefab to get the preview? I'm assu$$anonymous$$g I do, because it asks for the Object, not the Name.

avatar image
1

Answer by AngryAnt · Jun 30, 2012 at 09:50 AM

I don't think we have that level of access to the automatic preview. What you could do though is write an asset post processor which, on import of these specific prefabs:

  • Populates your list of buttons

  • Instantiates the prefab

  • Frames a camera on it by getting the combined renderer bounds

  • Render the camera to a texture

Once you have the basics in place you can play around with attaching a lighting setup to your camera, adding a bit of padding, framing the object and maybe placing it at a slight angle.

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
avatar image
-1

Answer by startassets · Mar 12, 2017 at 07:46 PM

@Mattivc I've just finished my own preview asset, maybe it will be useful for you: https://forum.unity3d.com/threads/powerful-preview.460157/

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 tanoshimi · Mar 12, 2017 at 10:26 PM 0
Share

This problem was already solved over 4 years ago...

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

8 People are following this question.

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

Related Questions

Why do my prefabs not have an Asset Preview? 1 Answer

How to get Project view's preview icon size? 0 Answers

Change angle of camera in prefab preview 4 Answers

Change angle of camera in prefab preview 1 Answer

Custom Thumbnails for Prefabs 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