Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can Not Access WWW.bytes in Webplayer

Discussion in 'Scripting' started by intoscienceDing, Jan 16, 2013.

  1. intoscienceDing

    intoscienceDing

    Joined:
    Nov 29, 2012
    Posts:
    10
    After update Unity3d Plugin update, WWW.bytes seem always get null in Webplayer, however it is fine in Editor. But the object can be initialized

    Here is the code

    Code (csharp):
    1.  
    2.     protected IEnumerator Load()
    3.     {
    4.         request =new WWW(url);
    5.         yield return request;
    6.        
    7.         Instantiate(request.assetBundle.mainAsset);
    8.        
    9.         size = request.bytes.Length;
    10.     }
    11.  
    12.  
    size always gets zero in webplayer, but it get the actual data in Editor.

    Here is the Asset Bundle Create Code

    Code (csharp):
    1.  
    2.     BuildPipeline.BuildAssetBundle(goObject,null,"test.unity3d",BuildAssetBundleOptions.CollectDependencies,BuildTarget.WebPlayer);
    3.  
    Thanks in advance
     
    Last edited: Jan 16, 2013
  2. intoscienceDing

    intoscienceDing

    Joined:
    Nov 29, 2012
    Posts:
    10
    Anyone can help?