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 vlePa · Oct 28, 2011 at 06:01 PM · guiframeratechrome

GUI framerate drop in Chrome

Hello there. I'm having some problems with the GUI as the title states. In some cases in Google Chrome the GUI framerate drops severely. It takes approximately 0.5 - 1 sec for the GUI button to switch its onHover style. This bug is completely random and I havent found a proper way to reproduce it every time. All I can say is that it happens only in Chrome on an iMac after I've started the game. If I click play and then from the 1st level go back (exit game) to mainMenu scene the framerate usually fixes, but not always.

Let me give you a little input on how I handle GUI.

I have a GUIBase class which has a Show() method. I have custom classes that inherit from GUIBase class and have their Show() methods overridden, respectively. Inside each custom class' Show() I have some GUI code.

I have a main object which has its GUI elements, a few buttons to be exact. Those buttons change state of a property called state which is then passed to a switch/case which determines which gui object to create and call its .Show() method.

I've tested inside editor, safari on iMac and IE, FF, Chrome and editor on windows. On windows it works flawlessly. Same goes for editor and Safari on a mac. I'm experiencing problems only with Chrome.

Any ideas?

Here is a fraction of the code.

GameManager:

 switch (state)
     {
         case "Login":
         LoginForm loginForm = new LoginForm();
         loginForm.Show();
         break;
             
         // REGISTER        
         case "Register":
         RegisterForm registerForm = new RegisterForm();
         registerForm.Show();
         break;
             
         // PROFILE
         case "Profile":
         ProfileForm profileForm = new ProfileForm();
         profileForm.Show();                
         break;
     }

And a fraction of the code from one of the classes. They are basically the same, they only carry different layouts of the GUI.

LoginForm:

 public override void Show()
 {
     Rect loginRegisterRect = new Rect(0, 0, Screen.width, Screen.height);
     
     if (loginRegisterRect.Contains(Event.current.mousePosition))
     {    
         GameManager.IsGUIButtonOver = true;
        }
     else
     {
         GameManager.IsGUIButtonOver = false;
     }

     GUILayout.BeginArea(loginRegisterRect, GameManager.CustomSkin.GetStyle("RegisterLoginBackground"));
     //LOGIN
     GUILayout.BeginVertical();
             
     GUILayout.Label("Login", "LabelLoginRegister");
     GUILayout.Label("Enter your details", "LabelExplanation");
     // labeli i input field
     GUILayout.BeginHorizontal();
     GUILayout.Label("E-mail"); GameManager.logOnModel.UserName = GUILayout.TextField(GameManager.logOnModel.UserName, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("Password"); GameManager.logOnModel.Password = GUILayout.PasswordField(GameManager.logOnModel.Password, "*"[0], 50);
     GUILayout.EndHorizontal();
                 
     GameManager.logOnModel.RememberMe = GUILayout.Toggle(GameManager.logOnModel.RememberMe, "Remember me");
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("", "ButtonCancel"))
     {
         GameManager.state = "Hide";
     }            
     if (GUILayout.Button("", "ButtonOk"))
     {
         Debug.Log("Login...");
         if(GameManager.logOnModel.IsValid)
         {
             GameManager.StartCoroutine(GameManager.LogIn());
             GameManager.logOnModel.Password = string.Empty; // Clear password from the Login Form
             GameManager.state = "Hide";
         }
         else
         {    
             GameManager.showErrorLabel = true;
         }
     }
     GUILayout.EndHorizontal();
     
     
     if(GameManager.showErrorLabel)
         GUILayout.Label("Error");
 
     GUILayout.EndVertical();
     GUILayout.EndArea();
 }

Maybe I'm doing something wrong. Or maybe its just the chrome unity plugin thats messed up. I can't really tell. I was hoping someone might have a solution.

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 vlePa · Oct 28, 2011 at 03:22 PM 0
Share

It appears its a Chrome problem and is nothing code related. Once the framerate drops one can easily open a new tab and then just return to the tab the game was initially loaded and everything is fine.

Strange.

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

2 People are following this question.

avatar image avatar image

Related Questions

GUI buttons aren't clickable in chrome. 0 Answers

GUI.Lable slowdown problem 0 Answers

Is Using Unity's Built In GUI Okay?(IOS) 1 Answer

Frame rate stutters regularly in Chrome + Flash 0 Answers

Integrating CefSharp into Unity 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