コード例 #1
0
        private void InitStringsArray()
        {
            FrameratePanel fp = target as FrameratePanel;

            fp.FramerateStrings = new string[MaxFPS + 1];

            for (int i = 0; i < fp.FramerateStrings.Length; i++)
            {
                if (i >= fp.FramerateStrings.Length - 1)
                {
                    fp.FramerateStrings[i] = i.ToString() + "+";
                }
                else
                {
                    fp.FramerateStrings[i] = i.ToString();
                }
            }
        }
コード例 #2
0
        private void InitStringsArray()
        {
            FrameratePanel fp = target as FrameratePanel;

            fp.FramerateStrings = new string[MaxFPS + 1];

            for (int i = 0; i < fp.FramerateStrings.Length; i++)
            {
                if (i >= fp.FramerateStrings.Length - 1)
                {
                    fp.FramerateStrings[i] = i.ToString() + "+" + " (<" + (1000f / (float)i).ToString("F") + "ms)";
                }
                else
                {
                    fp.FramerateStrings[i] = i.ToString() + " (" + (1000f / (float)i).ToString("F") + "ms)";
                }
            }
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (GUILayout.Button("Init strings array"))
            {
                FrameratePanel fp = target as FrameratePanel;

                for (int i = 0; i < fp.FramerateStrings.Length; i++)
                {
                    if (i >= fp.FramerateStrings.Length - 1)
                    {
                        fp.FramerateStrings[i] = i.ToString() + "+";
                    }
                    else
                    {
                        fp.FramerateStrings[i] = i.ToString();
                    }
                }
            }
        }