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
1
Question by grayger · Oct 25, 2013 at 01:45 AM · statistics

Statistics windows on a mobile device

Hi, I would like to see information like statistics windows (http://docs.unity3d.com/Documentation/Manual/RenderingStatistics.html) on a mobile device.

Is it possible? If not, is there an alternative to it?

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 AlvinHerawan · Jun 24, 2014 at 08:41 AM 0
Share

I'm having the same question and am still wondering for a better solution. Have you find any solution to this yet, grayger?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SAP · Dec 25, 2013 at 11:20 AM

You can calculate the fps and draw calls. Code below will show the draw calls and Fps if attached to a camera or any game object.

Please note that , you should extend draw calls function in script below, for counting GUI which exits on Screen.

using UnityEngine; using System.Collections;

public class ShowInfo : MonoBehaviour {

 public float updateInterval = 0.5F;

 private float accum = 0; // FPS accumulated over the interval
 private int frames = 0; // Frames drawn over the interval
 private float timeleft; // Left time for current interval
 private string fpsText;
 private GameObject[] AllObjects;
 private int DrawCalls;
 void CalculateFPS()
 {
     timeleft -= Time.deltaTime;
     accum += Time.timeScale / Time.deltaTime;
     ++frames;

     // Interval ended - update GUI text and start new interval
     if (timeleft <= 0.0)
     {
         // display two fractional digits (f2 format)
         float fps = accum / frames;
         string format = System.String.Format("{0:F2} FPS", fps);
         fpsText = format;

         timeleft = updateInterval;
         accum = 0.0F;
         frames = 0;
     }
 }
 void Draw_DrawCalls()
 {
     foreach (GameObject g in AllObjects)
     {
         if (g.renderer && g.renderer.isVisible)
         {
             DrawCalls++;
         }
     }
 }
 void Start () {
     timeleft = updateInterval;
     AllObjects = (GameObject[])GameObject.FindObjectsOfType(typeof(GameObject)) ;
     

 }
 
 // Update is called once per frame
 void Update () {
     CalculateFPS();
     Draw_DrawCalls();
 }
 void OnGUI() {
     GUI.Label(new Rect(0.0f, 0.0f, 100.0f, 25.0f), fpsText);
     GUI.Label(new Rect(0.0f, 50.0f, 200.0f, 25.0f), "Total Draw Calls : "+ DrawCalls.ToString());
 }

}

Hope this helps...

Comment
Add comment · Show 2 · Share
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 Benproductions1 · Dec 25, 2013 at 11:27 AM 0
Share

That's not a very accurate measure of draw-calls, especially when batching is enabled and the fact that the OnGUI function will add draw calls by itself. It also won't check for objects added after Start was called. Problems will also occur with a timeScale of 0. It should also check for disabled renderers and multiply the draw calls by the number of active cameras for more accurate results.

On that note, the number of draw calls from Editor to $$anonymous$$obile shouldn't be different :)

avatar image AlvinHerawan · Jun 24, 2014 at 08:43 AM 0
Share

I'm not too sure about the accuracy, but I kind of expect that there should be some easier way out to displaying this rendering statistics just like what Unity has in the Game view. Any answer to this problem yet?

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

Does anyone have figures which show the take-up ratio for new users hitting unity webplayers for the first time? 2 Answers

Creating Unity Statistics Plugin 0 Answers

Disabled Analytic and HW Statistic but Unity still use cdp.cloud.unity3d.com 1 Answer

Showing Full FPS 1 Answer

How to make a Linediagram 1 Answer


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