Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 markv12 · Feb 08, 2014 at 08:00 AM · assetfilesize

First scene of Unity project larger than what would be expected.

I'm creating a Unity2D game targeting the web and so I want streaming to work smoothly. I created a tiny scene with just a monochrome logo and loading bar. The image assets are around 500 bytes in total, but when I build, the first scene takes up 0.9mb compressed while the next scene which has significantly more assets only takes up 0.2mb. Because of this, the webplayer stays on the unity loading screen for a long time and only displays my tiny loading screen for a second before going into the game.

I assume that this must have something to do with the fact that I use a static class to manage my Audio so when the game starts up, it loads all the static stuff which forces the first scene to include the audio files. The code that actually loads the audio isn't called until later when the player starts the game.

 private AudioSource aSource;
 private AudioSource audioSource{
     get{
         if(aSource == null){
             aSource = gameObject.AddComponent<AudioSource>();
             aSource.clip = Resources.Load("Progenibeat") as AudioClip;
             aSource.loop = true;
             DontDestroyOnLoad (aSource);
         }
         return aSource;
     }

 }

Is there any way to structure how audio is handled so unity knows it doesn't need to load the audio files until later in the game.

It is also possible that there is some other reason the first scene is always larger, but there doesn't seem to be a way to check which files are loaded for each scene.

Many Thanks!

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

· 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

18 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

Related Questions

Performance interference of assets 0 Answers

After importing object from blender. 3dmax texture dosent work 2 Answers

Assets with illegal characters in the name 1 Answer

Rename a project on the asset server? 3 Answers

How to change default setting for imported assets? 4 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