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 rhylvin2017 · Dec 06, 2018 at 05:10 AM · wwwwindows store appwww.texture

Hololens url to texture is not working

URL to Texture is working if using Unity Editor but when I build for Hololens I get this error.

 ArgumentNullException: Value cannot be null.
 Parameter name: _unity_self
    at UnityEngineProxy.InternalCalls.UnityWebRequest_Get_Custom_PropIsDone(Object self)
    at UnityEngine.WWW.WaitUntilDoneIfPossible()
    at UnityEngine.WWW.CreateTextureFromDownloadedData(Boolean markNonReadable)
    at ShelfMarkingPage.<>c__DisplayClass7_0.<startLoadImage>b__0()
    at UnityThread.Update()
    at UnityThread.$Invoke10(Int64 instance, Int64* args)
    at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method) 

Here is my script:

         private IEnumerator startLoadImage()
         {
     #if !UNITY_EDITOR
             Debug.Log("Image: " + ShelfHandle.ShelfHandler.Instance.ShelfImageURL);
             using (WWW www = new WWW(ShelfHandle.ShelfHandler.Instance.ShelfImageURL))
             {
                 yield return www;
                 try
                 {
                     UnityThread.executeInUpdate(() =>
                     {
                         Debug.Log("startLoadImage");
                         // assign texture
                         Sprite spr = new Sprite();
                         Debug.Log("startLoadImage");
                         spr = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(0, 0), 100.0f);
                         Debug.Log("startLoadImage");
                         ShelfImage.GetComponent<Image>().sprite = spr;
                         Debug.Log("startLoadImage");
                         ShelfImage.SetActive(true);
                         Debug.Log("startLoadImage");
                     });
                 }
                 catch (Exception e)
                 {
                     Debug.Log(e.Message);
                 }
             }
     #else                           //test Shelf_ImageURL
             using (WWW www = new WWW("http://storage.rev-kitten.com/storage/static/uploads/pharmacy/4dc2a52e97040576d0e92d7ca20b6ae8.jpg"))
             {
                 yield return www;
                 try
                 {
                     Debug.Log("startLoadImage");
                     // assign texture
                     Sprite spr = new Sprite();
                     Debug.Log("startLoadImage");
                     spr = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(0, 0), 100.0f);
                     Debug.Log("startLoadImage");
                     ShelfImage.GetComponent<Image>().sprite = spr;
                     Debug.Log("startLoadImage");
                     ShelfImage.SetActive(true);
                     Debug.Log("startLoadImage");
                 }
                 catch (Exception e)
                 {
                     Debug.Log(e.Message);
                 }
             }
     #endif
         }
 
 

The error is in the Sprite.Create i think this means that the www is null. but why? it returned the www so it should have value already? I also tried using

 using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(ShelfHandle.ShelfHandler.Instance.ShelfImageURL))


same result. the uwr in this instance has been returned but with no value.

P.S. InternetClient, InternetClientServer is also turned on even though it is not needed for the editor.

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 RohitNutalapati · Dec 06, 2018 at 04:55 PM 0
Share

Try printing out isDone property of your WWW request.. "UnityEngine.WWW.WaitUntilDoneIfPossible()" I think its not waiting for download to complete..

0 Replies

· Add your reply
  • Sort: 

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

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

Texture loading via www.texture not loading! 2 Answers

Image is not loading into Texture 0 Answers

Image Displaying Bleached Texture. 0 Answers

could not open file file.png 1 Answer

Runtime Image Conversion (C#) .ICO to .PNG? (.ICO not supported; WWW.texture only accepts .PNG and .JPEG) 2 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