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 PnguinMster7 · Sep 28, 2016 at 03:23 PM · unity 5performanceloadingperformance optimization

Help performance issues

I have a game I'm trying to optimize the performance and when i build the game, to test it after clicking the start button to change scene and play the game(from main menu to gameplay). so i checked the profiler to se what was slowing it down and it says loading.updatePreloading and it takes 90% of the cpu and take-up to 1000ms to load. it happens overtime i load the particular scene but not during the gameplay. so can someone please tell me whats wrong.

Comment
Add comment · Show 2
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 zereda-games · Feb 22, 2019 at 05:45 AM 0
Share

This isn't a solution to your problem but has anyone ever considered doing this:

     public bool Debug$$anonymous$$ode = false;
     public Countries $$anonymous$$yCountry = Countries.Canada;
     public string PersonsName="Thamas Bell";
     public int PersonsAge=29;
     public string PersonsBirthday="Nov 11";

     public enum Countries {
          Africa,
          Australia,
          Brazil,
          Canada,
          China,
          England,
          France,
          Japan,
          Spain,
          USA
     }

     [SerializeField]static string SName="";
     [SerializeField]static int AAge="";
     [SerializeField]static string SBday="";
     [SerializeField]static bool fired=false;

     public List"<"string">" $$anonymous$$yList = new List"<"string">"(){
       string.Format("$$anonymous$$y name is: {0}", SName),
       string.Format("$$anonymous$$y Age is: {0}", AAge.ToString()),
       string.Format("$$anonymous$$y Birthday is: {0}", SBday),
       string.Format("I live in {0}", $$anonymous$$yCountry.ToString()),
     }

     void Awake(){
        SName=PersonsName;
        AAge=PersonsAge;
        SBday=PersonsBirthday;

        Debug$$anonymous$$ode =GetDebug$$anonymous$$ode();
        Debug.Log("Debug$$anonymous$$ode: " + Debug$$anonymous$$ode);
        if(Debug$$anonymous$$ode){
             Debug.Log("Hello World. How are you doing today?");
        }
     }

     void Update(){
        Debug$$anonymous$$ode =GetDebug$$anonymous$$ode();
        if(Debug$$anonymous$$ode){
             Debug.Log("Debug$$anonymous$$ode: " + Debug$$anonymous$$ode);
        }
        if(!fired){
             for(int i =0; i< $$anonymous$$yList.Count;i++){
                  Debug.Log($$anonymous$$yList[i]);
             }
             fired=true;
        }
     }
     public void SetDebug$$anonymous$$ode(Toggle enableToggle){
          if(enableToggle.isOn){
                PlayerPrefs.SetInt("Debug$$anonymous$$ode",1);
          } else{
                PlayerPrefs.SetInt("Debug$$anonymous$$ode",0);          
          }
     }

     public static bool GetDebug$$anonymous$$ode(){
          int enable = PlayerPrefs.GetInt("Debug$$anonymous$$ode",1);
          if(Equals(enable,1)){
                Debug$$anonymous$$ode =true;
                return Debug$$anonymous$$ode;
          } else{
                Debug$$anonymous$$ode =false;  
                return Debug$$anonymous$$ode;
          }
     }

Laid out in such a way as to be able to turn things off by a simple unity toggle. This same layout can be used for a number of things.

avatar image zereda-games zereda-games · Feb 22, 2019 at 05:48 AM 0
Share

Notice how i made a debug mode to turn the calls on and off when unneeded. this helps in a final build nicely so no to make too many extra calls and when you need to debug you just have to tick off 1 variable on a main manager and vwala..just for each class make a debug mode and a get debug mode from PP's to get the variable of the one i made you to turn it on and off on awake in you main manager. I use PP's for this little thing so players can use it too by editing their player pref's file and then i add a debug console to my game. only enabled if debug mode is enabled. simple simple.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

[Performance] RenderForwardAlpha performance issue on Android with Unity 5.3.0f4 0 Answers

UI performance on mobile. FPS drops 0 Answers

More than 20 instances of a certain script cause fps to skyrocket, is there something I'm doing wrong here? 0 Answers

Calling gameobject.transform vs. just calling transform directly - Performance negligible? 1 Answer

Figuring out which specific objects are slow to render? 0 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