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 /
  • Help Room /
avatar image
0
Question by ClearRoseOfWar · Jan 20, 2016 at 03:09 PM · editorprogrammingimages

[How To] Display Texture2D in editor window

Hi There,

I have been stuck for the last 24 hours on this (what seemed simple) problem.

There doens't seem to be to many options to do this, which is kinda strange because you'd think that with such little options, the answer would be right under my nose... but its not.

I've tried putting my textures into the Editor Default Resources Folder, and using EditorGUIUtility.Load but thats not working.

So this is what I've done for that:

 public static Texture2d Imagetoshow;
 Imagetoshow= EditorGUIUtility.Load("Imagetoshow" + num+ ext) as Texture2D;

From there I put it into a debug.Log and it returns as Null...

I've also tried to use EditorGUIUtility.FindTexture(path) as Texture2D;

but that wasn't working for me either...

I'm pretty sure that I'm just not using the api correctly...

I'd considered settling for a texture preview, but the image I am using is 512x256, so it would squish it, and wouldn't give the desired look (right?) that aside, the image size (but not dimensions) can be changed later if need be.

Can anyone please please please help me with this!!? This was supposed to be a quick and simple task, and has become a bit of a burden.

Thanks for your time!

EDIT: I'm not sure if i want to use resources.load because I don't want the images I'm using to be used in the build...

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
Best Answer

Answer by ClearRoseOfWar · Jan 20, 2016 at 04:29 PM

I've found success with using EditorGUIUtility.load("Must/be/a/valid/path/like/this.png") as Texture

My problem was cause num was not holding the correct number to be loaded... I always seem to solve my problems after I ask for help... I wish I knew all my future problems so I could ask them now :P

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

38 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 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

Project gets changed upon entering play mode 0 Answers

CustomPreferencesGUI has slow refresh in one scrpit, but not in another 1 Answer

[Editor Extensions] - Rotate object in editor mode 0 Answers

How to copy and paste animation events from one clip to another if those clips are included in FBXs? 1 Answer

Why Does Preference Item Restart whenever project is updated or played 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