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
1
Question by ina · Jun 08, 2011 at 11:44 AM · texture2druntimemissingassign

Assign Texture2D at runtime

Is it possible to assign a Texture2D that's taken from a screenshot at runtime? When I try this, the assigned texture2d reads "missing" in the inspector...

The texture2d screenshot worked because it successfully arrives at serverside

Brief outline of code:

 var tex  = new Texture2D( .... );
 tex.ReadPixel( ... );
 tex.Apply();
 assignedTexture2D=tex;

assignedTexture2D shows "missing" in inspector.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by chtngtr · Jun 08, 2011 at 12:58 PM

go through this link it might help you. http://unity3d.com/support/resources/example-projects/texture-plugins.html

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 ina · Jun 08, 2011 at 07:33 PM 0
Share

It would be a horrible miss on Unity's part if plugin's are required to assign texture2d at runtime.

avatar image
0

Answer by jahroy · Jun 09, 2011 at 11:07 PM

I'm not sure what you would expect to see in the inspector...

You're not assigning a named texture to the variable. You're assinging a texture that you built. It has no handle to the file system or the unity editor.

Also, when you make changes to your scene while playing your game, they are typically erased when you come out of play mode.

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 ina · Jun 10, 2011 at 07:38 AM 0
Share

the inspector shows a missing tag, and the texture displayed shows a question mark.

avatar image jahroy · Jun 10, 2011 at 08:11 AM 0
Share

Ok. I would suggest that showing the actual code will give you the best chance of getting the right answer. Of course I probably won't be the one who will be able to provide it!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Determine if a Texture2D has alpha 3 Answers

Changing Part Of Texture/Material 1 Answer

How to load an image at runtime via WWW correctly 1 Answer

Modifying mainTextureOffset increases draw calls 1 Answer

Change SpriteRenderers Texture2D in runtime 1 Answer


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