• 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 /
This question was closed May 31, 2016 at 08:55 AM by Prasanna for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Prasanna · Jan 10, 2015 at 11:19 AM · sceneassetbundlescene-loadingdownloadloadfromcacheordownload

Not download/load from cache for second time

Hi all, Here i created a assetbundle for scene by scene. I its perfectly loaded the scene first time but it doesn't load or even download the assetbundle,

 using UnityEngine;
 using System.Collections;
 
 public class Orbitrek_Elite : MonoBehaviour 
 {
     private string progress = " "; 
     private string logtxt;
     private string url = ;
     
     GUIStyle Font_Size;
 
     void Awake()
     {
         Font_Size = new GUIStyle ();
         Font_Size.fontSize = 40;
         Font_Size.normal.textColor = Color.black;
     }
 
     void log( string t )
     {
         
         logtxt += t + "/n";
     }
     void OnGUI()
     {
         Vector3 scale;
         
         float ResolutionX   = 1024;
         float ResolutionY   = 768;
         
         scale.x             = (float)Screen.width/ResolutionX;
         scale.y             = (float)Screen.height/ResolutionY;
         scale.z             = 1;
         
         Matrix4x4 svMat     = GUI.matrix;
         GUI.matrix          = Matrix4x4.TRS(new Vector3(0,0,0),Quaternion.identity,scale);
         
         GUI.Label (new Rect (560, 684, Screen.width - 5, Screen.height - 5), "Downloading: ", Font_Size);
         GUI.Label (new Rect(795, 684, Screen.width - 5, Screen.height - 5), logtxt + " " + progress, Font_Size);
     }
     
     IEnumerator Start()
     {
         using(WWW www = WWW.LoadFromCacheOrDownload (url, 1))
         { 
             while( !www.isDone )
             {
                 progress = " " + (www.progress * 100.0f).ToString("#") + " %";
                 yield return null;
             }
             yield return www;
             AssetBundle bundle = www.assetBundle;
             bundle.LoadAll();
             Application.LoadLevel("Orbit");
         }
     }
 }

In this script i try to load the scene, but its working smoothly when i load all scene in one time.

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

0 Replies

  • Sort: 

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

25 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

Related Questions

Can someone explain this exception? ArgumentException: SceneManager.SetActiveScene failed; invalid scene 2 Answers

Asset bundle not load the object, but it download 0 Answers

Why does a scene loaded from an Asset Bundle returns empty string when getting its name? 0 Answers

'Resource file has already been unloaded' error when exiting application in Editor 1 Answer

Using as AssetBundle to replace first scene 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges