Exemplo n.º 1
0
        private void OnGUI()
        {
            if (!IsOn)
            {
                return;
            }

            int w = Screen.width, h = Screen.height;

            GUIStyle style = new GUIStyle();

            int x = 5;

            if (anchor.Equals(TextAnchor.UpperRight) || anchor.Equals(TextAnchor.MiddleRight) || anchor.Equals(TextAnchor.LowerRight))
            {
                x = -x;
            }

            Rect rect = new Rect(x, 3, w, h * 2 / 100);

            style.alignment        = anchor;
            style.fontSize         = h * 2 / 100;
            style.normal.textColor = color;

            /*float msec = deltaTime * 1000.0f;
             * float fps = 1.0f / deltaTime;
             * string text = string.Format("{0:0.0} ms ({1:0.} fps)", msec, fps);
             * GUI.Label(rect, text, style);*/

            GUI.Label(rect, "FPS: " + currentFPSFrame, style);
        }